Gemini CLI Vulnerability: CVSS 10, Fixed Quietly in May

By 12 min read
Gemini CLI vulnerability CVE-2026-85259 turning a GitHub issue into commands on a triage runner

For more than six months, a CVSS 10 flaw in Google’s own AI triage pipelines had a fix but no name. The pull requests that closed it in May were titled “chore” and described as a generic standardisation; the CVE only appeared on 1 December 2026.

In short: the Gemini CLI vulnerability CVE-2026-85259 lets an unauthenticated attacker run commands or read sensitive files through a crafted GitHub issue, in the automated triage workflows of Gemini CLI (google-gemini/gemini-cli) and the google-github-actions/run-gemini-cli GitHub Action. Versions before 2026-05-12 are affected. It was first published on 1 December 2026 as GitHub advisory GHSA-g6vw-c6rx-j9ph and the matching CVE record, with Google as the issuing authority.

What is CVE-2026-85259?

CVE-2026-85259 is a code injection vulnerability in the GitHub workflows that use Gemini CLI to triage issues automatically. The GitHub advisory database classifies it as CWE-78, OS command injection, and scores it 10.0 under CVSS 4.0, the maximum: network attack, low complexity, no privileges, no user interaction, and high impact on both the vulnerable system and systems beyond it.

The official description is one sentence. It says an unauthenticated remote attacker can execute arbitrary commands or read sensitive files using crafted GitHub issue inputs, in Gemini CLI and run-gemini-cli GitHub Action versions prior to 2026-05-12.

Gemini CLI is Google’s open-source command-line AI agent. It runs Gemini models in a terminal and gives them tools such as shell commands and file reads. On 2 December 2026 the google-gemini/gemini-cli repository had 109,517 stars and 15,063 forks under the Apache-2.0 licence, and its latest release was v0.72.0. The npm package @google/gemini-cli was downloaded 516,442 times in the week of 24 to 30 November.

run-gemini-cli is the official GitHub Action that runs the same agent inside GitHub Actions, GitHub’s built-in CI/CD service. It had 2,140 stars and 293 forks. Its repository ships ready-made workflows for issue triage, pull request review and issue fixing that teams copy into their own repositories.

Four figures: CVSS score 10.0, 203 days from fix to CVE, 33 workflow files, 516K weekly downloads
A maximum score, a fix that predates the CVE by more than six months, and a tool with a very large install base. Data: GitHub advisory database, npm, gemini-cli PR 26897.

Who reported it, and when?

The first public record is the CVE entry and GitHub advisory GHSA-g6vw-c6rx-j9ph, published on 1 December 2026. Ostorlab gives the CVE publication time as 20:22 UTC; the GitHub advisory database shows 21:31 UTC. No earlier description of this specific flaw turned up in searches.

Neither the GitHub advisory nor Ostorlab names a reporter. A write-up republished on malware.news credits Dan Lisichkin, and Lisichkin, of Pillar Security, is also credited on the related April advisory. Treat the December attribution as reported by that one source until Google confirms it.

The fixes that came first

The advisory lists two references as the fix. Both are public pull requests from May:

  • run-gemini-cli PR 518, “chore: align checkout steps with standard practices”, merged on 11 May 2026. It touched 6 workflow files.
  • gemini-cli PR 26897, “chore: update checkout action configuration in workflows”, merged on 12 May 2026. It touched 33 workflow files and calls itself “a generic update”.

Both set persist-credentials: false on every actions/checkout step. Nothing in either pull request mentions security. This is a silent fix: the code was public for 203 days, but the risk was not.

Timeline from the April trust model fix through the May pull requests to the December CVE
The patches landed in May; defenders only learned they were security fixes on 1 December. Data: GitHub advisories and pull requests.

How does the Gemini CLI vulnerability work?

The public record gives no payload and no exact execution path. Ostorlab points this out directly. What the record does give, combined with the workflow files before and after the fix, shows the shape of the problem. This walk-through stays at that conceptual level.

Step 1: an issue starts an AI agent

The triage workflows fire automatically. The gemini-cli repository’s own automated triage workflow, as it stood before the fix, ran when an issue was opened or reopened and when an issue comment was created. On a public repository, anyone with a GitHub account can do both.

Step 2: untrusted text becomes part of the prompt

The issue title and body are written into the agent’s input. In the run-gemini-cli triage command template, they are inserted into the prompt through Gemini CLI’s shell expansion feature. In the gemini-cli workflow, they are written to a file that the agent is told to read. Either way, attacker-written text sits inside the instructions an AI model is following.

That is the setup for prompt injection: text crafted to make a language model ignore its task and follow the attacker’s instructions instead.

Step 3: the agent has tools on the runner

The pre-fix gemini-cli triage workflow allowed the agent two tools: read_file, and a shell tool restricted to echo. It also set GEMINI_CLI_TRUST_WORKSPACE to true, so the repository’s own configuration was trusted. The run-gemini-cli template goes further and tells the model to execute a shell command that writes its chosen labels into a file GitHub Actions reads between steps.

Step 4: a credential is waiting on disk

By default, actions/checkout saves the job’s GitHub token in the cloned repository’s .git/config file so later git commands work. That is what persist-credentials controls. Before May, the triage workflow’s checkout step did not turn it off. An agent with a file-reading tool, steered by an issue, sits a short distance from that token.

The May fix removes exactly that token from disk. Ostorlab notes the limit of that change: it does not stop commands that use a token passed to the job some other way. Google’s own workflows deliberately pass an empty GITHUB_TOKEN to the agent step and keep write access in a separate job.

Five-stage flow from a public GitHub issue to commands and file reads on the triage runner
The attacker never touches the runner directly; the AI agent does it for them. Data: GHSA-g6vw-c6rx-j9ph, gemini-cli workflow history, Ostorlab.

Where the sources disagree

The write-ups do not agree on the mechanism. Ostorlab argues that the template’s shell expansion on its own does not re-parse shell syntax, so it does not prove direct command injection before the model runs; it treats the CVE’s statement of command execution and file reading as the confirmed part. Other summaries call it plain shell injection. One AI-written news summary says credentials were exfiltrated; the record itself does not say that.

They also disagree on what the fix includes. Some summaries say the May changes also restricted tool allowlists; the two linked pull requests only change checkout settings. The malware.news write-up says it is unclear whether other changes belong to the fix.

Background: the April trust model update

CVE-2026-85259 is the second critical advisory for the same pairing this year. On 24 April 2026, Google published GHSA-wpqr-6v78-jr5g, now CVE-2026-12537, titled as remote code execution through workspace trust and tool allowlisting bypasses. It credits Elad Meged of Novee Security and Dan Lisichkin of the Pillar Security research team.

That advisory described two problems:

  • Folder trust in headless mode. Headless mode is Gemini CLI running without a human at the keyboard, as in CI. In that mode the CLI automatically trusted the workspace folder and loaded its configuration, so a malicious .gemini/ directory in a pull request could lead to code execution.
  • Allowlists ignored under –yolo. --yolo is the flag that lets the agent run tools without asking for approval. Under it, fine-grained tool allowlists were ignored, so an entry meant to allow only echo allowed any command.

Both were fixed in @google/gemini-cli 0.39.1 and 0.40.0-preview.3, and run-gemini-cli v0.1.22 followed the same day. The malware.news write-up stresses that the April update does not by itself cover the December CVE, because the affected range runs to 12 May.

How does it compare with similar CI flaws?

  CVE-2026-12537 CVE-2026-85259
Advisory GHSA-wpqr-6v78-jr5g GHSA-g6vw-c6rx-j9ph
Published 24 April 2026 1 December 2026
Severity Critical Critical, CVSS 4.0 10.0
Component CLI trust model, tool allowlists Triage workflows
Trigger Untrusted folder or input in headless mode Crafted GitHub issue
Fix CLI 0.39.1, 0.40.0-preview.3 Releases and revisions from 2026-05-12
Fix labelled as security Yes, with advisory No, “chore” pull requests
Exploited in the wild Not reported Not reported

The pattern will be familiar to anyone who followed the wfx-loot GitHub Actions secret stealer: CI jobs that touch untrusted input and hold secrets are the target. The difference here is the middleman. Classic script injection needs attacker text to land inside a shell command. With an AI agent in the job, attacker text only needs to persuade the model, which is the same weakness behind AGENTS.md malware that instructs coding assistants.

Who is affected?

You are exposed if all of these are true:

  1. A repository runs Gemini CLI or run-gemini-cli in GitHub Actions.
  2. The workflow is triggered by issues, issue comments or pull request text from people you do not fully trust. On a public repository, that is everyone.
  3. The workflow file, the action revision or the CLI version predates 12 May 2026.

Private repositories are not automatically safe. Ostorlab notes that outside collaborators or lower-trust members who can open issues are enough.

How to check your exposure

  • Search your organisation’s code for run-gemini-cli and @google/gemini-cli inside .github/workflows/.
  • For each hit, look at the triggers (issues, issue_comment, pull_request_target), the pinned action revision, and any gemini_cli_version input.
  • Check every actions/checkout step in those workflows for persist-credentials: false.
  • Remember that copied workflow files never update themselves. Updating the npm package does not change a YAML file someone pasted into your repository in 2025.
Bar chart comparing 33 workflow files changed in gemini-cli with 6 in run-gemini-cli
Google hardened 39 workflow files across two repositories; your copies of those files need the same change. Data: run-gemini-cli PR 518, gemini-cli PR 26897.

How do you detect exploitation?

No indicators of compromise have been published, and the sources list no MITRE ATT&CK mapping. Detection therefore means reviewing what your triage agents did.

Log sources

  • GitHub Actions run logs for every triage, review and issue-fixer run. Brandefense advises looking for unexpected commands, file access or credential use.
  • Gemini CLI telemetry. The run-gemini-cli triage workflow writes local telemetry to .gemini/telemetry.log and can upload artifacts; the gemini-cli workflow sent telemetry to Google Cloud. Tool calls recorded there show what the agent actually ran.
  • GitHub audit log for token use from unfamiliar addresses, label or issue edits you cannot explain, and new deploy keys or webhooks.
  • Cloud and model provider logs for your Gemini or Google API keys, looking for use outside your runners.

Behaviours worth flagging

  • Issues or comments that address the AI directly, contain shell syntax, or ask it to read files such as .git/config.
  • Triage runs that call tools other than the expected label write, or that run longer than usual.
  • Outbound connections from triage runners to hosts other than GitHub and Google APIs, which the malware.news write-up also recommends reviewing.

How do you fix CVE-2026-85259?

In priority order:

  1. Stop the trigger. If you cannot audit today, disable issue and comment triggers on Gemini triage workflows, or gate them behind a maintainer label or a manual workflow_dispatch, as Ostorlab and malware.news both suggest.
  2. Update the code. Move @google/gemini-cli to a current release (v0.72.0 on 2 December 2026) and pin run-gemini-cli to a full commit SHA from 12 May 2026 or later. If you set gemini_cli_version, raise it too.
  3. Add persist-credentials: false to every actions/checkout step in workflows that run an agent, whatever the agent.
  4. Shrink the agent’s tools. Remove shell tools and --yolo from workflows that read untrusted text, and keep any allowlist to the narrowest set of commands. The run-gemini-cli triage workflow already set an empty core tool list before the fix.
  5. Split privileges. Keep the agent job read-only with no GitHub token, and do writes such as labelling in a separate job, as Google’s own workflows do.
  6. Rotate secrets if a vulnerable workflow ran on public input: Gemini and Google API keys, GitHub App private keys, and anything else the job could read.
  7. Review past runs back to when the workflow was added, using the log sources above.

If your organisation connects GitHub to cloud identity, also read our guide to GitHub attack paths into tier zero; a token from a CI runner can be a starting point, not an end.

It is not a remote hack of Gemini

A CVSS 10 headline invites panic, so it is worth being precise about the limits.

  • It does not affect the Gemini model or Google’s hosted services. It affects workflows that you run in your own repositories.
  • It needs a workflow that feeds untrusted issue text to an agent. A developer using Gemini CLI interactively on their own code is not the scenario described.
  • What an attacker gains depends on what the job holds. Google’s own workflows passed an empty token to the agent step and kept issue writes in another job, which limits the damage even before the fix.
  • No one has reported exploitation, and there is no public proof of concept.

The score reflects the worst case: a public repository, a permissive workflow, and secrets on the runner. Many copied workflows will match that.

Open questions

  • The exact path. The record names the impact but not the technique. Ostorlab and other summaries read the same evidence differently.
  • The full fix. Only two checkout-hardening pull requests are cited. Whether other May changes belong to the fix has not been stated.
  • The reporter. Only one secondary source names one.
  • The delay. Neither Google nor the advisory explains why a CVSS 10 issue fixed in May was published in December, or whether downstream users were told earlier.
  • Real-world exposure. No source counts how many public repositories still run pre-May copies of these workflows.

The bottom line

CVE-2026-85259 shows that an AI agent in CI turns every issue box into an input field for your build runner. The code fix is six months old, but copied workflows do not patch themselves, so search your repositories for Gemini triage workflows, cut their triggers and tools, and turn off persisted credentials today.

Sources

This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.

Frequently asked questions

What is CVE-2026-85259?

CVE-2026-85259 is a critical code injection vulnerability (CWE-78, CVSS 4.0 score 10.0) in the automated triage workflows of Google Gemini CLI and the run-gemini-cli GitHub Action. A crafted GitHub issue could make the workflow run attacker commands or read sensitive files.

Which Gemini CLI versions are affected by CVE-2026-85259?

The advisory gives a date, not a version number: Gemini CLI and run-gemini-cli versions and revisions prior to 2026-05-12 are affected. Anything released or committed on or after 12 May 2026 contains the fix.

Is the Gemini CLI vulnerability being exploited?

As of 2 December 2026, none of the sources reviewed report exploitation in the wild, no public proof of concept, and no CISA KEV listing. Ostorlab and Brandefense both describe exploitation as not confirmed.

Do I need to do anything if I use Gemini CLI only on my laptop?

The advisory is about automated triage workflows on GitHub Actions, where untrusted issue text reaches the agent. Updating the CLI is still sensible, but the urgent work is in repositories that run Gemini CLI on issues, comments or pull requests.

What does persist-credentials: false do?

It tells the actions/checkout step not to leave the job's GitHub token in the repository's .git/config file after cloning. Without it, any process in the job, including an AI agent with a file-reading tool, can read that token from disk.

How is CVE-2026-85259 different from CVE-2026-12537?

CVE-2026-12537 (GHSA-wpqr-6v78-jr5g, April 2026) fixed workspace trust and tool allowlisting in Gemini CLI 0.39.1. CVE-2026-85259 covers the triage workflows themselves and is fixed by changes from 12 May 2026, so the April update alone does not cover it.

Should I rotate secrets after CVE-2026-85259?

If a vulnerable triage workflow ran on a public repository, yes. Ostorlab and malware.news both advise rotating the Gemini or Google API keys and any GitHub App private key that was available to the job, and reviewing past triage runs.

Keep reading

Gemini CLI vulnerabilityCVE-2026-85259run-gemini-cliGitHub Actionsprompt injectionCI/CD securityvulnerability management