{
  "id": "gemini-cli-issue-triage",
  "url": "https://ohshit.app/incidents/gemini-cli-issue-triage/",
  "title": "Gemini CLI legacy issue-triage workflows allow runner code execution from crafted issues",
  "level": 3,
  "level_name": "sharted",
  "date": "2026-12-01",
  "date_is_approximate": false,
  "updated": null,
  "tags": [
    "Gemini CLI",
    "GitHub Actions",
    "CI",
    "prompt injection"
  ],
  "ecosystems": [
    "node"
  ],
  "summary": "Google disclosed CVE-2026-85259 in legacy Gemini CLI and run-gemini-cli issue-triage workflows. Crafted public issues can cause runner command execution or sensitive-file reads. Update copied workflows as well as tooling, remove retained credentials and rotate exposed secrets; no exploitation is confirmed.",
  "splash": "Legacy Gemini issue-triage on GitHub Actions; untrusted issue text can reach runner tools and credentials.",
  "wipe": "Disable legacy triage; use hardened workflows, action and CLI, disable checkout credential persistence and rotate runner secrets.",
  "in_the_wild": "no",
  "source_exception": null,
  "cves": [
    {
      "id": "CVE-2026-85259",
      "score": 10,
      "name": "Gemini automated-triage code injection",
      "description": "Google assigns CVSS 4.0 10.0 to crafted-issue command execution or sensitive-file access in legacy Gemini CLI and run-gemini-cli workflows; also GHSA-g6vw-c6rx-j9ph."
    }
  ],
  "fixed": [],
  "checklist": [
    {
      "title": "Disable legacy public-issue triage while reviewing every execution path",
      "hint": "Search tracked .github and .gemini files, package manifests and lockfiles for google-github-actions/run-gemini-cli or @google/gemini-cli. Review other branches, reusable workflows and runner images too. Check opened/reopened issues separately from comment events: a collaborator check on comments does not authorize public issue content. A configuration match alone is not evidence of exploitation."
    },
    {
      "title": "Update copied workflow configuration together with the action and CLI",
      "hint": "Follow Google's CNA remediation and the two linked upstream hardening PRs; inspect the actual YAML and pin reviewed action revisions to full commit SHAs. Set persist-credentials: false under each relevant actions/checkout step. The affected cutoff is a date, May 12, 2026, not a semantic package version; changing a CLI dependency cannot rewrite an old copied workflow."
    },
    {
      "title": "Remove unnecessary tools and isolate privileged operations",
      "hint": "Restrict coreTools and avoid unrestricted run_shell_command or --yolo for untrusted issue/PR analysis. Minimize GitHub permissions and cloud identity, and check explicit tokens/API keys as well as checkout authentication. An empty GITHUB_TOKEN environment variable does not erase .git/config credentials. Keep privileged label/write operations in a separately authorized job consuming validated output; a later step on the same runner is not an isolation boundary."
    },
    {
      "title": "Rotate secrets available to affected runners and investigate prior runs",
      "hint": "Google explicitly calls for rotating repository secrets present on those runners, including GEMINI_API_KEY and APP_PRIVATE_KEY. The historical example names its App secret PRIVATE_KEY; inspect the actual names in your workflows. Inventory GitHub App private keys, issued tokens and cloud identities actually exposed to the job, revoke or rotate them through their issuers, and preserve workflow/audit logs for the affected configuration period. Updating YAML cannot revoke a copied secret; no malicious domain, hash or victim list is published in the cited records."
    },
    {
      "title": "Validate the replacement before restoring external triggers",
      "hint": "Use a test repository with dummy credentials. Confirm expected triage, authorization on every trigger, resolved CLI/action revisions, restricted tool behavior and validated outputs before granting write permissions. Review historical network/process evidence where available, without treating a shell invocation or GitHub connection by itself as proof of compromise."
    }
  ],
  "sources": [
    {
      "name": "Google CNA CVE record and remediation",
      "url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/85xxx/CVE-2026-85259.json",
      "says": "GoogleCloud record published December 1 at 20:22:16 UTC: date-based affected scope, CVSS 4.0 10.0, crafted issue inputs, tool restrictions, checkout persistence and secret rotation. CISA enrichment dated December 2 lists exploitation as none.",
      "primary": true
    },
    {
      "name": "GitHub advisory alias record",
      "url": "https://github.com/advisories/GHSA-g6vw-c6rx-j9ph",
      "says": "Same CVE under an unreviewed GHSA published December 1. No affected package/version mapping or fixed package release is supplied; this is not another vulnerability.",
      "primary": true
    },
    {
      "name": "Gemini CLI checkout-hardening PR #26897",
      "url": "https://github.com/google-gemini/gemini-cli/pull/26897",
      "says": "Original metadata and diff: merged May 12, adds checkout persistence opt-out in 33 workflow files. The generic public PR predates the December security disclosure.",
      "primary": true
    },
    {
      "name": "run-gemini-cli checkout-hardening PR #518",
      "url": "https://github.com/google-github-actions/run-gemini-cli/pull/518",
      "says": "Original metadata and diff: merged May 11, changes six workflow files; four edits replace quoted false with boolean false. Neither PR alone is a complete agent-workflow remediation.",
      "primary": true
    },
    {
      "name": "Historical Gemini automated issue-triage workflow",
      "url": "https://raw.githubusercontent.com/google-gemini/gemini-cli/9f759f97a2d30d5738e93642c5da4806fb749ab8/.github/workflows/gemini-automated-issue-triage.yml",
      "says": "Complete pre-hardening configuration: separate issue/comment trigger conditions, checkout v5 without persistence opt-out, issue_context.md, read_file/restricted echo tool, empty GITHUB_TOKEN, Gemini API and workload identity inputs, and later label-writing credentials. Repository-name and existing-label conditions limit this specific example.",
      "primary": true
    },
    {
      "name": "StepSecurity historical-workflow analysis",
      "url": "https://www.stepsecurity.io/blog/cve-2026-85259-gemini-cli-triage-flaw-lets-issue-authors-run-code-in-github-actions",
      "says": "December 3 original analysis of the historical configurations, retained checkout authentication, workflow-specific exposure and layered remediation; no claim of observed victim exploitation.",
      "primary": true
    }
  ],
  "headline": null,
  "one_liner": "Issue text meant to choose a label can influence an agent running on a credential-bearing CI machine, crossing from untrusted data into privileged tools.",
  "in_the_wild_note": "CISA enrichment lists exploitation as none on December 2; no victim count is published.",
  "mitigation": null,
  "timeline": [
    {
      "date": "May 11, 2026",
      "title": "run-gemini-cli checkout-hardening change merged",
      "body": "PR #518 adjusts six workflow files. Four already disabled persistence using a quoted false value; those edits normalize YAML rather than introduce a new protection."
    },
    {
      "date": "May 12, 2026",
      "title": "Gemini CLI checkout-hardening change merged",
      "body": "PR #26897 adds persist-credentials: false across 33 workflows. These are configuration changes, not a published fixed npm version."
    },
    {
      "date": "Dec 1, 2026, 20:22 UTC",
      "title": "Google publishes the vulnerability and remediation",
      "body": "The CNA record describes unauthenticated code injection, a date-based affected range before May 12, and four remediation steps. The GHSA record follows later that day."
    },
    {
      "date": "Dec 2, 2026",
      "title": "CISA enrichment records no exploitation",
      "body": "Its dated SSVC assessment lists exploitation as none and the attack as automatable. This is not proof that every deployed workflow is safe."
    },
    {
      "date": "Dec 3, 2026",
      "title": "StepSecurity analyzes the historical trigger and credential path",
      "body": "The analysis explains why comment-author checks do not protect issue-opening triggers and why an empty GITHUB_TOKEN variable does not remove checkout credentials retained on disk."
    }
  ],
  "body_markdown": "Google disclosed CVE-2026-85259 on December 1 for automated triage workflows using Gemini CLI and the run-gemini-cli GitHub Action. Crafted GitHub issue inputs can let an unauthenticated remote attacker execute commands or read sensitive files on the runner. The same issue is tracked as GHSA-g6vw-c6rx-j9ph. Google's CVSS 4.0 score is 10.0; the available record does not confirm attacks or identify victims, so this is rated L3 rather than a confirmed exploitation incident.\n\nExposure depends on the workflow, not merely installing Gemini. Google's affected range is date-based, before May 12, 2026, for legacy automated triage configurations. A newer repository can still copy an old workflow; a repository using Gemini without this untrusted-input/tool/credential path is not automatically affected. No fixed npm version or complete supported-branch package range is supplied, so a normal dependency upgrade or version checker is insufficient.\n\nThe historical Gemini CLI triage workflow shows separate paths for opened/reopened issues and comment requests. Comments need an authorized author association, but that check does not cover the issue-opening path. Repository-name and existing area-label conditions also apply to this particular example. It writes issue content through environment variables into issue_context.md, then lets the agent read that file with read_file and a restricted echo shell tool. Passing values through environment variables avoids direct shell-expression interpolation at that preparation step; it does not make issue text trusted instructions. This is a workflow trust-boundary problem, not evidence that every invocation permits unrestricted shell access.\n\nThe Gemini analysis step clears GITHUB_TOKEN, yet checkout v5 previously retained Git authentication in .git/config in the same workspace. Readable credentials can remain available even when one environment variable is empty. The job also has Gemini API and cloud workload-identity inputs, and later label-writing steps use credentials. The May hardening PRs disable checkout persistence; they do not revoke credentials explicitly provided to the agent or replace all other tool, trigger and permission controls.\n\nGoogle requires updating hardened workflows and tooling or disabling legacy triage, disabling checkout credential persistence, restricting tools and rotating secrets that were present on affected runners. Audit every trigger and separate untrusted analysis from narrowly authorized writes. Preserve prior run and issuer audit evidence when investigating exposure. CISA's December 2 enrichment lists no exploitation, which must not be turned into a guarantee that deployments are safe. No attack IoCs or confirmed loss total are published by these sources."
}