{"slug": "gemini-cli-github-actions-rce-cve-2026-85259", "title": "Gemini CLI GitHub Actions RCE (CVE-2026-85259)", "summary": "Google published CVE-2026-85259 on 2026-12-01 for a command-injection flaw (CWE-78, CVSS v4.0 10.0 Critical) in Gemini CLI's automated issue-triage workflows, which passed issue titles and bodies to a shell-capable agent and let crafted issue text run commands on the GitHub Actions runner in builds before 2026-05-12. Any public repository running the legacy `run-gemini-cli` triage, review or issue-fixer workflows before that date is exposed, and the CLI has 516,442 weekly npm downloads. No public proof of concept or exploitation is reported and the flaw is not in CISA KEV as of 2026-12-02; remediation requires updating the action and CLI to builds from 2026-05-12 or later (latest CLI 0.71.1 from 2026-11-24), setting `persist-credentials: false`, restricting shell tools and rotating `GEMINI_API_KEY` and `APP_PRIVATE_KEY`.", "body_md": "[Deep Dive](https://blog.ostorlab.co/category/deep-dive.html)\n\n# Gemini CLI GitHub Actions RCE (CVE-2026-85259)\n\nGemini CLI issue workflows before 2026-05-12 could let crafted issue input execute commands. Review these workflows, permissions and credential exposure.\n\n## TL;DR\n\n- Gemini CLI's automated issue-triage workflows passed the issue title and body to a shell-capable agent. A crafted issue could run commands on the GitHub Actions runner. Google published CVE-2026-85259 on 2026-12-01.\n- Any public repository running the legacy `run-gemini-cli` triage, review or issue-fixer workflows before 2026-05-12 is exposed. The CLI has 516,442 weekly npm downloads.\n- The CVE record rates it CVSS v4.0 10.0 Critical (CWE-78). No public proof of concept and no exploitation are reported, and it is not in CISA KEV as of 2026-12-02.\n- Update the action and the CLI to builds from 2026-05-12 or later, set `persist-credentials: false` , restrict shell tools and rotate`GEMINI_API_KEY` and`APP_PRIVATE_KEY` . See \"How do I fix it?\".\n\n## Am I affected?\n\nYou are exposed when all of these conditions hold:\n\n- A workflow uses `google-github-actions/run-gemini-cli` , or the Gemini CLI triage commands, at a revision before 2026-05-12.\n- The workflow runs on issue or pull-request text that an outsider can write.\n- The agent has a vulnerable path from untrusted input to command execution, including access to shell tools.\n- The issue-triggered workflow runs without a maintainer approval gate.\n\nPersisted checkout credentials and other accessible secrets increase the impact; their presence is not required for command execution.\n\nPublic repositories are the main exposure. A maintainer can still be attacked through a pull request from a fork, because the workflow runs on text the contributor controls. Private repositories are exposed when a lower-trusted member or an outside collaborator can open issues or pull requests.\n\nThe CVE gives a date, not a semantic version. Google fixed the workflows on 2026-05-12, so the table uses that date as the cut-off. The latest CLI release is 0.71.1 from 2026-11-24.\n\n| Component | Affected builds | Fixed builds | \n|---|---|---|\n| `run-gemini-cli` GitHub Action | Commits before 2026-05-12 | Commits from 2026-05-12 | \n| `@google/gemini-cli` | Releases before 2026-05-12 | Releases from 2026-05-12; latest 0.71.1 | \n| Triage command templates | `!{echo ...}` interpolation of issue text | Hardened templates plus tool restrictions | \n\nFind the workflows in a repository:\n\n```\ngrep -R \"run-gemini-cli\" .github/workflows\n```\n\nFind the issue-triggered commands:\n\n```\ngrep -R -E \"gemini-(triage|scheduled-triage|issue-fixer|invoke)\" .github/workflows\n```\n\nCheck whether the checkout persists the token:\n\n```\ngrep -R -A6 \"actions/checkout\" .github/workflows | grep -n \"persist-credentials\"\n```\n\nAn empty result means at least one checkout still uses the default, which persists the token in the local Git configuration. Check every workflow that processes untrusted input, not only the first match.\n\nCheck the CLI version on the runner:\n\n```\nnpx @google/gemini-cli --version\n```\n\nCheck the action reference and its date:\n\n```\ngrep -R \"google-github-actions/run-gemini-cli@\" .github/workflows\n```\n\nCheck whether shell execution is enabled in the workflow settings:\n\n```\ngrep -R -E \"run_shell_command|--yolo|coreTools\" .github/workflows .gemini\n```\n\n## How do I fix it?\n\nUpdate the action and the CLI, remove the persisted token, restrict the agent's tools and rotate the secrets. A single change is not enough.\n\n1. Update the CLI to 0.71.1 or later:\n\n```\nnpm install -g @google/gemini-cli@0.71.1\n```\n\n1. \nUpdate `google-github-actions/run-gemini-cli` to a commit from 2026-05-12 or later. The upstream examples use`@main` , which is not a fixed target. Pin the action to a full commit SHA in the hardened range and record that SHA in the workflow.\n2. \nAdd `persist-credentials: false` to every`actions/checkout` step in the affected workflows:\n\n```\n- uses: actions/checkout@v6\n  with:\n    persist-credentials: false\n```\n\n1. \nRemove `run_shell_command` and`--yolo` from the triage jobs. Keep the GitHub MCP tool allowlist narrow, as the hardened`gemini-invoke` and`gemini-review` examples do.\n2. \nDisable or delete the legacy automated triage workflows if you cannot harden them. A maintainer approval gate or a label trigger that only maintainers can apply also removes the anonymous path.\n3. \nRotate `GEMINI_API_KEY` ,`APP_PRIVATE_KEY` ,`GOOGLE_API_KEY` and every other secret that was present on a runner that executed a vulnerable workflow. Removing the workflow does not revoke a token that was already read.\n\n`persist-credentials: false` prevents checkout from persisting its credential. Commands may still use other available credentials, including `GITHUB_TOKEN`; restrict tools and permissions and require approval for untrusted input.\n\nIf you cannot upgrade, the workaround is to stop running the agent on untrusted input:\n\n1. Disable the `issues` and`pull_request` triggers on the Gemini workflows.\n2. Run the triage only from a `workflow_dispatch` event that a maintainer starts.\n3. Keep the checkout's `persist-credentials` at`false` and scope`GITHUB_TOKEN` to`contents: read` .\n\nThe workaround limits who can supply input; it does not repair the vulnerable agent execution path. A maintainer must still review the input before starting a manual run.\n\n## What is the root cause?\n\nThe templates run `!{echo $ISSUE_TITLE}` and `!{echo $ISSUE_BODY}` through the CLI shell processor and append the command output to the model prompt. Ordinary shell expansion does not reparse metacharacters inside those environment values as commands. This ingestion path alone does not establish direct shell injection before the model runs.\n\n```\n# .github/commands/gemini-triage.toml\n**Issue Title**:\n```\n!{echo $ISSUE_TITLE}\n```\n\n**Issue Body**:\n```\n!{echo $ISSUE_BODY}\nThe same pattern appears in the issue fixer, which places the title and body inside an XML context block:\n\n```\n# .github/commands/gemini-issue-fixer.toml\n<issue>\n    <repository>!{echo $REPOSITORY}</repository>\n    <number>!{echo $ISSUE_NUMBER}</number>\n    <title>!{echo $ISSUE_TITLE}</title>\n    <body>!{echo $ISSUE_BODY}</body>\n</issue>\n```\n\nThe workflow passes the issue fields into the job environment, and the checkout keeps the GitHub token by default:\n\n```\n# .github/workflows/gemini-issue-fixer.yml\n- name: 'Run Gemini PR Create'\n  uses: 'google-github-actions/run-gemini-cli@main'\n  env:\n    GITHUB_TOKEN: '${{ steps.mint_identity_token.outputs.token || secrets.GITHUB_TOKEN }}'\n    ISSUE_TITLE: '${{ github.event.issue.title }}'\n    ISSUE_BODY: '${{ github.event.issue.body }}'\n```\n\nThe workflow explicitly supplies `GITHUB_TOKEN` to the agent step and passes provider keys as action inputs. `APP_PRIVATE_KEY` is an input to an earlier token-minting step, not an agent environment variable. Exposure depends on credentials and files actually accessible to the affected process.\n\nThe CVE confirms command execution and file reading through crafted issue input in legacy workflows. The public record does not provide the exact payload or execution sequence; the template excerpts alone cannot establish it.\n\n## How is it exploited?\n\n1. An attacker submits crafted issue input to an affected legacy workflow.\n2. The workflow incorporates that input into the agent prompt.\n3. The vulnerable agent/tool path may execute commands with the job’s permissions.\n4. Those commands may read accessible files or credentials and use token permissions to modify the repository.\n\nThe public advisory does not supply an exact payload. A semicolon or command substitution in an environment value is not, by itself, a demonstrated reproduction.\n\n## How does the attack flow?\n\nCrafted issue input reaches an agent prompt; the vulnerable agent/tool path may execute commands with the job’s permissions.\n\n## What can an attacker do?\n\nAn attacker who obtains command execution can access files and credentials available to that process. The workflow explicitly passes `GITHUB_TOKEN`; provider keys are action inputs. The earlier token-minting step’s `APP_PRIVATE_KEY` is not shown in the agent environment. Repository changes require a token with the necessary permissions. The CVE confirms command execution and file reading, without demonstrating every possible downstream impact.\n\n## Why does the fix work?\n\nThe linked patches add `persist-credentials: false` to checkout steps. The advisory separately recommends restricting tools. These are distinct controls: checkout hardening prevents checkout from persisting its credential, while tool restrictions reduce what the agent can execute.\n\n```\n--- a/.github/workflows/gemini-invoke.yml\n+++ b/.github/workflows/gemini-invoke.yml\n@@\n       - name: 'Checkout Code'\n         uses: 'actions/checkout@v4'\n         with:\n-          # no persist-credentials setting: the token stays in .git/config\n+          persist-credentials: 'false'\n--- a/.github/workflows/gemini-issue-fixer.yml\n+++ b/.github/workflows/gemini-issue-fixer.yml\n@@\n       - name: 'Checkout repository'\n         uses: 'actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8'\n         with:\n-          # no persist-credentials setting\n+          persist-credentials: 'false'\n```\n\nThe linked patches establish checkout hardening, not removal of shell tools. `persist-credentials: false` does not prevent commands from using another credential, including an explicitly supplied `GITHUB_TOKEN`. Restrict agent tools, minimize token permissions and gate untrusted input.\n\nRotate credentials according to the advisory and the exposure of affected workflow runs. Do not infer that every job secret was an agent environment variable.\n\n## How do I check if I was compromised?\n\nStart with the workflow runs that handled issues from outside contributors. GitHub records the actor and the event for each run.\n\nList the recent issue-triggered runs:\n\n```\ngh run list --event issues --limit 100\n```\n\nList the pull-request runs from forks:\n\n```\ngh run list --event pull_request --limit 100\n```\n\nFor a suspect run, download the logs and search for shell syntax in the issue text and for outbound requests:\n\n```\ngh run view <run-id> --log > run.log\ngrep -nE '\\$\\(|`|;|&&|\\|\\|' run.log | head -50\n```\n\nSearch for requests to unfamiliar hosts in the runner log:\n\n```\ngrep -nE 'https?://' run.log | grep -vE 'github.com|githubusercontent.com|googleapis.com|google.com' | head -50\n```\n\nCheck the repository's audit log for pushes, branch creations and pull requests by the GitHub App or `github-actions`:\n\n```\ngh api /repos/<owner>/<repo>/events --paginate | jq '.[] | select(.actor.login == \"github-actions[bot]\")'\n```\n\nNo indicators of compromise are published for this CVE. A command that ran and failed may leave no trace beyond the workflow log, and a token that was read and used elsewhere may leave no entry in this repository. Treat a run on a vulnerable workflow with an untrusted issue as a lead, not as proof.\n\n## Timeline\n\n- 2026-05-11: Pull request 518 merges and aligns more checkout steps with the same setting.\n- 2026-05-12: Pull request 26897 merges in the Gemini CLI repository, and Google treats this date as the fix cut-off.\n- 2026-12-01: Google publishes CVE-2026-85259 at 20:22 UTC.\n\n## FAQ\n\n**Does the CVE affect the Gemini model or the CLI binary?**\nNo. It affects the GitHub Actions triage workflows that wrap the CLI and pass issue text to it. The model itself is not the vulnerable component.\n\n**I use the CLI locally. Am I affected?**\nNo, unless you run one of the affected workflow templates on untrusted issue text. The CVE is scoped to the GitHub Actions triage workflows.\n\n**Is `persist-credentials: false` enough?**\n`persist-credentials: false` prevents checkout from persisting its credential. Commands may still use other available credentials, including `GITHUB_TOKEN`; restrict tools and permissions and require approval for untrusted input.\n\n**Do I need to rotate the keys if I never saw an attack?**\nFollow the advisory’s rotation guidance for credentials potentially exposed by affected runs. The absence of an observed attack does not establish that accessible credentials were safe.\n\n**Is the latest CLI version fixed?**\nThe latest release is 0.71.1 from 2026-11-24, which is after the 2026-05-12 cut-off. The workflow files are separate, so update the action and the templates too.\n\n**Can a private repository be attacked?**\nYes, if a lower-trusted member or an outside collaborator can open an issue or a pull request that triggers the workflow. The token and the secrets are the same.\n\n## References\n\n- CVE-2026-85259 record, https://www.cve.org/CVERecord?id=CVE-2026-85259 (checked December 2, 2026)\n- GitHub Advisory Database, GHSA-g6vw-c6rx-j9ph, https://github.com/advisories/GHSA-g6vw-c6rx-j9ph (checked December 2, 2026)\n- Gemini CLI pull request 26897, checkout hardening, https://github.com/google-gemini/gemini-cli/pull/26897 (checked December 2, 2026)\n- run-gemini-cli pull request 518, checkout hardening, https://github.com/google-github-actions/run-gemini-cli/pull/518 (checked December 2, 2026)\n- run-gemini-cli issue triage command, https://github.com/google-github-actions/run-gemini-cli/blob/main/.github/commands/gemini-triage.toml (checked December 2, 2026)\n- run-gemini-cli issue fixer command, https://github.com/google-github-actions/run-gemini-cli/blob/main/.github/commands/gemini-issue-fixer.toml (checked December 2, 2026)\n- run-gemini-cli issue fixer workflow, https://github.com/google-github-actions/run-gemini-cli/blob/main/.github/workflows/gemini-issue-fixer.yml (checked December 2, 2026)\n- run-gemini-cli repository, https://github.com/google-github-actions/run-gemini-cli (checked December 2, 2026)\n- npm package, @google/gemini-cli, https://www.npmjs.com/package/@google/gemini-cli (checked December 2, 2026)\n- CISA Known Exploited Vulnerabilities catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog (checked December 2, 2026)\n- Gemini CLI shell processor, https://github.com/google-gemini/gemini-cli/blob/main/packages/cli/src/services/prompt-processors/shellProcessor.ts (checked December 2, 2026)\n\nKeep reading\n\n## Related articles\n\n[Browse the blog](https://blog.ostorlab.co/)", "url": "https://wpnews.pro/news/gemini-cli-github-actions-rce-cve-2026-85259", "canonical_source": "https://blog.ostorlab.co/gemini-cli-github-actions-rce-cve-2026-85259.html", "published_at": "2026-12-01 23:20:00+00:00", "updated_at": "2026-12-02 02:43:19.866702+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-safety", "developer-tools"], "entities": ["Google", "Gemini CLI", "CVE-2026-85259", "GitHub Actions", "run-gemini-cli", "CISA KEV", "Ostorlab"], "also_reported_by": [], "takeaway": "Gemini CLI issue-triage workflows before 2026-05-12 interpolated untrusted issue text into shell-capable agent commands, so pin `run-gemini-cli` to a commit SHA from 2026-05-12 or later, set `persist-credentials: false` on every checkout, and rotate `GEMINI_API_KEY` and `APP_PRIVATE_KEY`.", "recommendation": {"advice": "Pin `run-gemini-cli` to a full commit SHA from 2026-05-12 or later, disable persisted checkout credentials and restrict shell tools on issue-triggered workflows, then rotate `GEMINI_API_KEY` and `APP_PRIVATE_KEY`.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/gemini-cli-github-actions-rce-cve-2026-85259", "markdown": "https://wpnews.pro/news/gemini-cli-github-actions-rce-cve-2026-85259.md", "text": "https://wpnews.pro/news/gemini-cli-github-actions-rce-cve-2026-85259.txt", "jsonld": "https://wpnews.pro/news/gemini-cli-github-actions-rce-cve-2026-85259.jsonld"}}