CVE-2026-13745: Arbitrary Code Execution in Gemini CLI via Untrusted Local .env Files Overriding GEMINI_CLI_HOME

Published Sep 10, 2026
·
Updated

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

1 affected component
Google Gemini CLI<0.39.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Gemini CLI to a version that resolves this vulnerability.

    Fixed in 0.39.1
  2. 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

Sep 10, 2026
CVE Published
via MITRE·08:33 AM
Data Sourced
via MITRE·08:33 AM
RemedyDescriptionWeakness
Data Sourced
via NVD·09:17 AM
DescriptionSeverityWeakness
Jan 8, 58698
Event
via NVD·08:19 AM

Frequently Asked Questions

1

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.

2

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203