Skip to main content
VulnerabilityPublished Updated

CVE-2026-12537: Gemini CLI · Remote Code Execution via workspace trust and tool allowlisting bypasses

Affects gemini-cliSource GCVE Database

0
Compare
Authoritative record:CVE-2026-12537· Critical 10.0

Not known to be exploited · CVSS 10.0 Critical : upgrade to 0.40.1 as a priority.

Data as of 29 Oct 2026, 19:04 UTC

CVSS 4.0 base score
10.0Critical
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.2% chance of exploitation in 30 days – higher than 11% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 0.40.1
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/U:Clear

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 24 Jun 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.

What to do

Upgrade gemini-cli to 0.40.1.

Affected software

ProductAffectedFixed in
Homebrewgemini-clipkg:brew/gemini-cliOther threatsAffected
  • <0.40.1
Fixed in
  • 0.40.1

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available in Gemini CLI version 0.40.1 that addresses these vulnerabilities by requiring explicit folder trust in headless mode and enforcing tool allowlisting under --yolo mode. Users should upgrade to version 0.40.1 or later. For workflows running on trusted inputs, set the environment variable GEMINI_TRUST_WORKSPACE to 'true'. For workflows processing untrusted inputs, follow the guidance in the run-gemini-cli GitHub Action documentation to harden workflows against malicious content. Review and update tool allowlists as necessary to ensure only safe commands are permitted. Existing workflows specifying older Gemini CLI versions should be updated promptly.

Description

Gemini CLI versions prior to 0.40.1 have vulnerabilities related to workspace trust and tool allowlisting in headless (CI) environments. Previously, Gemini CLI automatically trusted workspace folders in headless mode, which could allow remote code execution if untrusted folders contained malicious environment variables. Additionally, in --yolo mode, tool allowlisting was bypassed, potentially enabling arbitrary command execution. These issues are addressed in version 0.40.1, which requires explicit folder trust and enforces tool allowlisting even in --yolo mode. Users running Gemini CLI in CI workflows, especially on untrusted inputs, must update to patched versions and adjust trust settings accordingly.

References

Community reviews

Loading reviews…