Findings

CVE-2026-12537

Gemini CLI: Remote Code Execution via workspace trust and tool allowlisting bypasses

Published Apr 24, 2026 · updated Sep 25, 2026

# Summary Gemini CLI ( ) and the GitHub Action are being updated to harden workspace trust and tool allowlisting, in particular when used in untrusted environments like GitHub Actions. This update introduces a breaking change to how non-interactive (headless) environments handle folder trust, which may impact existing CI/CD workflows under specific conditions. # Details Folder Trust in Headless Mode In previous versions, Gemini CLI running in CI environments (headless mode) automatically trusted workspace folders for the purpose of loading configuration and environment variables. This is potentially risky in situations where Gemini CLI runs on untrusted folders in headless mode (e.g. CI workflows that review user-submitted pull requests). If used with untrusted directory contents, this could lead to remote code execution via malicious environment variables in the local directory. To ensure consistency and user control, the latest update aligns headless mode behavior with interactive mode, requiring folders to be explicitly trusted before configuration files (such as ) are processed. As a result of this change, GitHub Actions and other automated pipelines that rely on the previous automatic trust behavior will fail to load workspace-specific settings until they are updated to use explicit trust mechanisms. Tool Allowlisting under \--yolo In previous versions, when Gemini CLI was configured to run in mode, it would ignore any fine grained tool allowlist in (e.g. would allow any command). This is potentially risky in situations where Gemini CLI runs on untrusted inputs with (e.g. CI workflows that triage user-submitted GitHub issues where we recommend a strict allowlist). If used with untrusted content and a tool allowlist that permits , this could lead to remote code execution via prompt injection. In version , the Gemini CLI policy engine now evaluates tool allowlisting under mode, which is useful for CI workflows that allowlist a few safe commands to run when proces

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Apr 24, 2026 · GitHub Advisory Database

    Detected

    # Summary Gemini CLI ( ) and the GitHub Action are being updated to harden workspace trust and tool allowlisting, in particular when used in untrusted environments like GitHub Actions. This update introduces a breaking change to how non-interactive (headless) environments handle folder trust, which may impact existing CI/CD workflows under specific conditions. # Details Folder Trust in Headless Mo

  2. Sep 25, 2026 · GitHub Advisory Database

    Fix available

    @google/gemini-cli fixed in 0.39.1; @google/gemini-cli fixed in 0.40.0-preview.3; google-github-actions/run-gemini-cli fixed in 0.1.22

  3. Sep 25, 2026 · GitHub Advisory Database

    Fix available

    @google/gemini-cli fixed in 0.39.1

  4. Sep 25, 2026 · GitHub Advisory Database

    Fix available

    @google/gemini-cli fixed in 0.40.0-preview.3

  5. Sep 25, 2026 · GitHub Advisory Database

    Fix available

    google-github-actions/run-gemini-cli fixed in 0.1.22

  6. Sep 25, 2026 · GitHub Advisory Database

    Updated

    # Summary Gemini CLI ( ) and the GitHub Action are being updated to harden workspace trust and tool allowlisting, in particular when used in untrusted environments like GitHub Actions. This update introduces a breaking change to how non-interactive (headless) environments handle folder trust, which may impact existing CI/CD workflows under specific conditions. # Details Folder Trust in Headless Mo

Affected

  • GitHub Actions google-github-actions/run-gemini-cli0 → 0.1.22
  • npm @google/gemini-cli0 → 0.39.1
  • npm @google/gemini-cli0.40.0-preview.2 → 0.40.0-preview.3

Sources

  • CVE.orgVulnerability recordCVE-2026-12537

    Official CVE identifier

    cve.org
  • GitHub Advisory DatabasePackage advisoryGHSA-wpqr-6v78-jr5g

    GitHub Advisory Database record mirrored by OSV.

    github.com
  • OSV.devPackage advisoryGHSA-wpqr-6v78-jr5g

    Gemini CLI: Remote Code Execution via workspace trust and tool allowlisting bypasses

    osv.dev

References