CVE-2026-13745: Arbitrary Code Execution in Gemini CLI via Untrusted Local .env Files Overriding GEMINI_CLI_HOME
A vulnerability in the Gemini CLI prior to version 0.39.1 allows attackers to achieve arbitrary code execution by tricking a victim into starting the CLI within an untrusted directory. The vulnerability is triggered via untrusted .env files overriding GEMINICLIHOME to load malicious configuration files and bypass folder trust prompts.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Gemini CLIto a version that resolves this vulnerability.Fixed in 0.39.1 - Configuration
If the CI workflow operates only on fully trusted data, set GEMINI_TRUST_WORKSPACE to 'true' in the workflow.
Gemini CLI GEMINI_TRUST_WORKSPACE = true
Event History
Frequently Asked Questions
Does an attacker need elevated privileges to exploit this issue?
No. The issue is described as exploitable by an unprivileged attacker when untrusted local .env files can override GEMINI_CLI_HOME.
Which components should be included in triage?
Triage should include both Google Gemini CLI and the associated GitHub Action, as both are identified as affected by the provided information.