CVE-2026-13745 is a serious vulnerability in Google’s Gemini CLI and its associated GitHub Action. It can allow an attacker to execute arbitrary code on a developer workstation or automation system by abusing untrusted local .env files. Organizations that use AI-assisted development tools, especially engineering teams working with open-source repositories or third-party code, should treat this as an urgent patching priority.
The risk is not limited to large technology companies. Any business whose developers, security teams, or automation pipelines use Gemini CLI may be exposed. This post explains what the vulnerability means for your operations, data, reputation, and compliance obligations. It also provides practical detection, verification, and remediation guidance for technical teams in the appendix.
CVE-2026-13745 was published on September 10, 2026, and affects Gemini CLI versions before 0.39.1 as well as the run-gemini-cli GitHub Action before version 0.1.22. The issue was reported by Benjamin Faller of Redguard AG.
The vulnerability allows an unprivileged attacker to achieve arbitrary code execution through untrusted local .env files that override the GEMINI_CLI_HOME environment variable. In practical terms, a malicious project folder can influence where Gemini CLI loads its configuration, potentially causing it to run attacker-controlled instructions.
Google addressed the issue in Gemini CLI 0.39.1 and in version 0.1.22 of the associated GitHub Action. The CVE record assigns it a CVSS v4.0 base score of 9.2, classified as Critical, although other vulnerability databases list a CVSS v4.0 score of 7.7, classified as High. The difference reflects differing scoring interpretations, but both ratings signal a vulnerability that warrants prompt action.
If your teams use Gemini CLI, this vulnerability can turn a routine development task into an entry point for an attacker. A developer who opens or runs the tool inside an untrusted directory, such as a downloaded repository, a vendor-provided code sample, or a public open-source project, may unintentionally execute malicious code on their workstation.
The immediate business risk is loss of control over the affected machine. An attacker who gains code execution can access source code, credentials, cloud tokens, customer data, internal documentation, and connected development systems. From there, they may move into source-control platforms, cloud environments, continuous integration systems, or internal networks.
Operationally, an incident could interrupt product delivery, corrupt code, expose intellectual property, or force your team to rotate credentials and rebuild affected systems. If customer data, regulated financial information, or protected health information is accessible from the compromised environment, notification and regulatory obligations may follow.
Reputationally, a breach involving a widely used AI developer tool can undermine customer confidence, particularly if attackers access source code or deployment credentials. The most effective response is to inventory usage, update affected components, and verify that no suspicious configuration files or automation changes were introduced.
Regional financial services firm: A development team uses Gemini CLI to accelerate code reviews and documentation. A contractor clones a third-party repository containing a malicious .env file and runs the CLI in that folder. The attacker gains access to internal source code and cloud credentials, creating a risk of unauthorized access to customer account systems and regulatory reporting data.
Mid-sized software company: Engineers use the Gemini CLI GitHub Action in continuous integration workflows. An attacker contributes code to an open-source dependency that modifies the automation environment. If the organization has not updated the action, malicious code could run with access to build secrets, deployment credentials, and production release pipelines.
Healthcare technology provider: A developer uses Gemini CLI on a laptop that also stores saved credentials for a cloud environment containing patient-facing application data. Exploitation could expose authentication tokens and source code, forcing the organization to investigate whether protected health information was accessible and to document the incident for compliance purposes.
Small professional services firm: A two-person engineering team downloads an AI-generated project template from an online forum and runs Gemini CLI inside it. Although the firm has limited infrastructure, the compromised workstation contains client files, email access, and administrative credentials, giving an attacker a foothold into client-facing systems.
run-gemini-cli GitHub Action version 0.1.21 or earlier..env files that can override GEMINI_CLI_HOME or otherwise influence Gemini CLI configuration..env files used with Gemini CLI and its associated GitHub Action.IntegSec helps organizations identify exposed developer tooling, validate exploitation paths, and reduce the risk of code-execution incidents before they disrupt the business. Our penetration testing team can assess your development environment, CI/CD pipeline, endpoint controls, and cloud access boundaries. Visit https://integsec.com to schedule a conversation and take a practical step toward stronger cyber resilience.
CVE-2026-13745 arises from improper validation of local environment configuration in Gemini CLI. An untrusted .env file can override GEMINI_CLI_HOME, causing the CLI to load attacker-controlled configuration from an unintended location. This can bypass folder-trust prompts and lead to execution of malicious configuration or command content.
The affected components are Gemini CLI prior to 0.39.1 and the Google run-gemini-cli GitHub Action prior to 0.1.22. The attack vector involves preparing a directory with a malicious .env file and inducing a user or automation workflow to start Gemini CLI there.
The CVE record lists CWE-20, Improper Input Validation, and CWE-78, Improper Neutralization of Special Elements Used in an OS Command. The published CVSS v4.0 vector is 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/U:Amber, with a base score of 9.2. The NVD reference is https://nvd.nist.gov/vuln/detail/CVE-2026-13745.
Version enumeration commands:
Scanner signatures: Search software inventory, endpoint management data, and dependency manifests for gemini-cli, @google/gemini-cli, and google-github-actions/run-gemini-cli. Flag any CLI version below 0.39.1 and any Action version below 0.1.22.
Log indicators: Review developer endpoint, EDR, GitHub Actions, and CI logs for Gemini CLI launches in unexpected directories, modifications to .env files, changes to GEMINI_CLI_HOME, or execution of unfamiliar configuration files.
Behavioral anomalies: Look for unexpected child processes spawned by Gemini CLI, unusual compiler or interpreter execution, credential-file access, new outbound connections, GitHub token use from unusual locations, or workflow changes made shortly after repository clones.
Network exploitation indicators: Monitor developer workstations and CI runners for outbound connections to unknown infrastructure immediately following Gemini CLI execution, particularly connections associated with payload retrieval, command-and-control activity, or credential exfiltration.
run-gemini-cli GitHub Action to version 0.1.22 or later. Inventory all developer laptops, build agents, containers, and workflow definitions to ensure no vulnerable copies remain..env files that set GEMINI_CLI_HOME in untrusted directories..env files in third-party repositories as untrusted input, not harmless configuration.