{"id":"CVE-2026-13745","state":"PUBLISHED","title":"Arbitrary Code Execution in Gemini CLI via Untrusted Local .env Files Overriding GEMINI_CLI_HOME","description":"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 GEMINI_CLI_HOME to load malicious configuration files and bypass folder trust prompts.","publishedAt":"2026-09-10T08:33:09.309Z","updatedAt":"2026-09-23T09:48:39.517Z","severity":{"score":7.7,"label":"High","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/U:Amber","source":"GoogleCloud"},"assigner":"GoogleCloud","products":["Google Cloud Gemini CLI"],"affected":[{"vendor":"Google Cloud","product":"Gemini CLI","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"0.39.1","versionType":"custom"}],"repo":"https://github.com/google-gemini/gemini-cli"}],"references":["https://github.com/google-gemini/gemini-cli/releases/tag/v0.39.1","https://www.redguard.ch/blog/2026/06/03/advisory-google-gemini-cli/","https://www.pwned.info/articles/homing-in-on-arbitrary-code-execution-within-gemini-cli/"],"weaknesses":["CWE-829","CWE-15"],"ingestedAt":"2026-10-29T20:11:00.674Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/13xxx/CVE-2026-13745.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-13745","state":"PUBLISHED","datePublished":"2026-09-10T08:33:09.309Z","dateUpdated":"2026-09-23T09:48:39.517Z","assignerShortName":"GoogleCloud","assignerOrgId":"f45cbf4e-4146-4068-b7e1-655ffc2c548c","dateReserved":"2026-06-29T15:39:28.269Z"},"containers":{"cna":{"title":"Arbitrary Code Execution in Gemini CLI via Untrusted Local .env Files Overriding GEMINI_CLI_HOME","descriptions":[{"lang":"en","value":"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 GEMINI_CLI_HOME to load malicious configuration files and bypass folder trust prompts."}],"affected":[{"vendor":"Google Cloud","product":"Gemini CLI","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"0.39.1","versionType":"custom"}],"repo":"https://github.com/google-gemini/gemini-cli"}],"references":[{"url":"https://github.com/google-gemini/gemini-cli/releases/tag/v0.39.1"},{"url":"https://www.redguard.ch/blog/2026/06/03/advisory-google-gemini-cli/"},{"url":"https://www.pwned.info/articles/homing-in-on-arbitrary-code-execution-within-gemini-cli/"}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"PASSIVE","vulnConfidentialityImpact":"HIGH","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"AMBER","version":"4.0","baseSeverity":"HIGH","baseScore":7.7,"vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/U:Amber"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-829","lang":"en","description":"CWE-829 Inclusion of functionality from untrusted control sphere","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-15","lang":"en","description":"CWE-15 External Control of System or Configuration Setting","type":"CWE"}]}],"providerMetadata":{"shortName":"GoogleCloud","orgId":"f45cbf4e-4146-4068-b7e1-655ffc2c548c","dateUpdated":"2026-09-23T09:48:39.517Z"},"impacts":[{"capecId":"CAPEC-38","descriptions":[{"lang":"en","value":"CAPEC-38 Leveraging/Manipulating Configuration File Search Paths"}]},{"capecId":"CAPEC-13","descriptions":[{"lang":"en","value":"CAPEC-13 Subverting Environment Variable Values"}]}],"solutions":[{"lang":"en","value":"*  Upgrade: Ensure you are using the latest version of gemini cli and follow the best practices guide https://github.com/google-github-actions/run-gemini-cli/blob/main/docs/trust-guidance.md\n  *  Configure Trust: Determine if your CI workflow operates on trusted or untrusted data. If the data is fully trusted, set GEMINI_TRUST_WORKSPACE: 'true' in your workflow.","supportingMedia":[{"type":"text/html","base64":false,"value":"<div><ol><li><strong>Upgrade</strong>: Ensure you are using the latest version of gemini cli and follow the best practices guide https://github.com/google-github-actions/run-gemini-cli/blob/main/docs/trust-guidance.md</li><li><strong>Configure Trust</strong>: Determine if your CI workflow operates on trusted or untrusted data. If the data is fully trusted, set&nbsp;<code>GEMINI_TRUST_WORKSPACE: 'true'</code>&nbsp;in your workflow.</li></ol></div>"}]}],"credits":[{"lang":"en","value":"Benjamin Faller, Redguard AG","type":"finder"}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"Vulnogram 1.0.2"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-09-10T15:03:19.734151Z","id":"CVE-2026-13745","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-09-10T15:03:41.131Z"}}]}}}