IntegSec - Next Level Cybersecurity

CVE-2026-13745: Gemini CLI Code Execution Bug - What It Means for Your Business and How to Respond

Written by Mike Chamberland | 11/28/26, 10:29 PM

CVE-2026-13745: Gemini CLI Code Execution Bug - What It Means for Your Business and How to Respond

Introduction

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.

Background & History

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.

What This Means for Your Business

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.

Real-World Examples

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.

Am I Affected?

  • You are running Gemini CLI version 0.39.0 or earlier.
  • You use the Google run-gemini-cli GitHub Action version 0.1.21 or earlier.
  • Your developers routinely run Gemini CLI in directories obtained from outside your organization, including public repositories, vendor samples, downloads, or AI-generated project templates.
  • Your repositories contain .env files that can override GEMINI_CLI_HOME or otherwise influence Gemini CLI configuration.
  • Your GitHub Actions workflows use Gemini CLI with access to secrets, deployment credentials, cloud tokens, or production systems.
  • Your endpoint or source-control monitoring does not alert on unexpected configuration changes, unusual child processes, or outbound connections from developer machines.
  • You have not confirmed through asset inventory that all developer workstations, containers, and CI runners have been updated to the fixed versions.

Key Takeaways

  • CVE-2026-13745 can allow arbitrary code execution through malicious local .env files used with Gemini CLI and its associated GitHub Action.
  • Organizations using Gemini CLI before version 0.39.1, or the GitHub Action before version 0.1.22, should update immediately.
  • Developer workstations and automation pipelines are high-value targets because they often hold source code, secrets, and cloud access.
  • Opening untrusted repositories or running AI tools in unverified folders creates a realistic path for exploitation.
  • A fast response should include version inventory, patching, credential review, log analysis, and stronger controls over untrusted project directories.

Call to 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.

Technical Appendix

A — Technical Analysis

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.

B — Detection & Verification

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.

C — Mitigation & Remediation

  1. Immediate (0–24h): Update affected components. Upgrade Gemini CLI to version 0.39.1 or later and the 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.
  2. Immediate (0–24h): Restrict untrusted execution. Instruct staff not to run Gemini CLI inside unverified repositories, downloaded archives, or AI-generated project folders. Where feasible, block or warn on .env files that set GEMINI_CLI_HOME in untrusted directories.
  3. Short-term (1–7d): Hunt for compromise. Review endpoint, GitHub, CI/CD, identity-provider, and cloud logs for suspicious activity dating back before the patch deployment. Rotate exposed GitHub tokens, cloud credentials, SSH keys, and service-account credentials if compromise cannot be ruled out.
  4. Short-term (1–7d): Harden automation. Apply least privilege to GitHub Actions workflows, limit secret scope, pin actions to patched versions, and prevent workflows from inheriting broad cloud permissions. Require review for changes to workflow files and environment configuration.
  5. Long-term (ongoing): Establish AI tooling governance. Maintain an inventory of AI developer tools, include them in vulnerability management, test untrusted-repository handling, and use endpoint detection rules for suspicious process and network behavior.
  6. Interim mitigation: If patching is delayed, isolate affected developer systems from sensitive production resources, disable or restrict the GitHub Action, block execution in untrusted directories through policy controls, and require sanitized project copies before Gemini CLI use.

D — Best Practices

  • Treat .env files in third-party repositories as untrusted input, not harmless configuration.
  • Keep Gemini CLI, GitHub Actions, and all developer dependencies on supported, patched versions.
  • Apply least privilege to developer workstations, CI runners, cloud identities, and repository tokens.
  • Require code review and automated policy checks for workflow, environment, and configuration changes.
  • Monitor for unexpected process execution, configuration overrides, and outbound network activity from development systems