Google has rolled out urgent security updates for its Gemini CLI and the accompanying GitHub Action to address a critical vulnerability.
Tracked as GHSA-wpqr-6v78-jr5g, this flaw exposes continuous integration and continuous deployment (CI/CD) pipelines to Remote Code Execution (RCE) attacks.
Improper handling of workspace trust and tool allowlisting allows malicious actors to compromise automated workflows, raising significant supply chain security concerns.
Understanding the Attack Vectors
The vulnerability stems from two distinct bypasses within the Gemini CLI environment. When deployed in automated, non-interactive environments like GitHub Actions, the tool previously processed data with excessive privileges.
Security researchers Elad Meged from Novee Security and Dan Lisichkin from Pillar Security identified two primary exploitation methods:
- In headless mode, workspace folders are automatically trusted, allowing attackers to execute code via malicious environment variables in untrusted directories.
- The Yolo execution mode ignored fine-grained tool allowlists, allowing attackers to bypass restrictions and achieve remote code execution via prompt injection.
- Improper input validation mechanisms failed to neutralize special elements, directly leading to severe operating system command injection vulnerabilities.
This critical-severity flaw poses a significant risk to software supply chains. Automated pipelines frequently review user-submitted pull requests or triage public GitHub issues.
If a workflow runs the vulnerable Gemini CLI against an attacker’s untrusted code without proper safeguards, the system automatically loads the malicious configuration files.
This automatic trust behavior creates a direct pathway for unauthorized actors to execute arbitrary code on the build server.
Once compromised, attackers could potentially steal sensitive repository secrets, alter source code, or pivot deeper into the organization’s infrastructure.
The vulnerability requires no elevated privileges or user interaction, making it highly exploitable over a network.
Google has released patches that fundamentally change how the Gemini CLI handles automated tasks.
Headless modes now align with interactive modes, requiring explicit trust configurations before processing any environment variables or configuration files.
Organizations using these tools must immediately review their pipelines and apply the following fixes:
- Upgrade the NPM package for the Gemini CLI to version 0.39.1 or 0.40.0-preview.3.
- Update the accompanying GitHub Action to the patched version 0.1.22.
- Add the workspace trust environment variable for workflows running on trusted internal inputs.
- Implement strict tool allowlists for any workflows processing untrusted external inputs.
- Audit all existing GitHub Actions that specify older, vulnerable versions of the command-line interface.
Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.





