ZeroHour

CVE-2026-13745

large

Arbitrary Code Execution in Google Gemini CLI via Untrusted .env File Override

CVSS 4.0
9.2 critical
EPSS
Published
()
Modified
AI analysis

A critical flaw in Google's Gemini CLI and its associated GitHub Action allows an unprivileged attacker to achieve arbitrary code execution by causing untrusted local .env files to override the GEMINI_CLI_HOME environment variable. The flaw is triggered when Gemini CLI runs in a directory containing a hostile or attacker-controlled .env file, which redirects the tool's home/configuration path and leads to command execution (CWE-20, CWE-78). An attacker gains the ability to run arbitrary code in the context where Gemini CLI executes — a developer workstation, a local project checkout, or a CI runner when triggered via the GitHub Action, potentially exposing source code, credentials, and secrets available to that environment. Affected users are developers and organizations that run Gemini CLI locally or invoke it through the associated GitHub Action in automated workflows. There is no known exploitation, no public proof-of-concept, and the issue is not in CISA's KEV catalog, though the CVSS 4.0 score of 9.2 (critical) with a network vector and high impact on confidentiality, integrity, and availability indicates it is exploitable under the right conditions.

What to do: Upgrade Gemini CLI and the associated GitHub Action to the latest patched releases per Google's advisory, since fixed version numbers are not specified in the available data. Until patched, audit project directories for untrusted .env files before running Gemini CLI, avoid letting untrusted .env files override GEMINI_CLI_HOME, and review GitHub Actions workflows that use the action — restrict GITHUB_TOKEN permissions and pin the action to the patched version to limit blast radius in CI.

Affected
Google Gemini CLI
Google Gemini CLI associated GitHub Action
Estimated exposure
largeroughly 100k–1M developer installations plus CI usage via the associated GitHub Action (estimate) — Gemini CLI is Google's rapidly adopted open-source command-line AI tool used both on developer workstations and in GitHub Actions CI pipelines, so exposure is measured by installed developer base rather than internet-exposed devices, and…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

A vulnerability in the Gemini CLI and associated GitHub Action allowed an unprivileged attacker to achieve an arbitrary code execution in Gemini CLI via untrusted local .env files overriding GEMINI_CLI_HOME.

Weakness
CWE-20, CWE-78
Vector
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:L/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

In the news

No ingested article mentions this CVE yet.