Critical Gemini CLI Vulnerabilities
Critical Gemini CLI Vulnerabilities
1. Critical RCE in CI/CD (CVSS 10.0 – GHSA‑wpqr‑6v78‑jr5g)
- A maximum‑severity Remote Code Execution (RCE) flaw was discovered in Google’s Gemini CLI (
@google/gemini-cli) and therun-gemini-cliGitHub Action. - In headless/CI environments, Gemini CLI automatically trusted workspace folders, loading
.gemini/configuration and environment variables without review or sandboxing, allowing attackers to execute arbitrary commands on the host before sandbox initialization. - Exploitation required no authentication, no user interaction, and no prompt injection.
Impact
- Full host command execution in CI/CD runners
- Theft of secrets, tokens, and credentials
- Software supply‑chain compromise via malicious pull requests
Affected versions
@google/gemini-cli< 0.39.1@google/gemini-cli≤ 0.40.0-preview.2google-github-actions/run-gemini-cli< 0.1.22
Fixed versions
@google/gemini-cli0.39.1, 0.40.0-preview.3run-gemini-cli0.1.22
Root causes
- Implicit workspace trust in headless mode
- Tool allowlist bypass in
--yoloexecution mode - Improper input validation (CWE‑20, CWE‑77, CWE‑78, CWE‑200)
2. Tool Allowlist Bypass & Prompt‑Injection‑Assisted RCE (CI Context)
What happened
- In
--yolomode, earlier Gemini CLI versions ignored fine‑grained tool allowlists, meaning that allowing one safe command implicitly allowed any shell command. - When combined with untrusted inputs (e.g., GitHub issues or PR text), attackers could achieve RCE via prompt injection, even in workflows that appeared locked down.
Impact
- RCE in automated workflows processing external content
- Silent execution of unauthorized commands
Mitigation
- Patched versions now enforce tool allowlists even in
--yolomode - CI workflows may fail until allowlists are explicitly updated
3. Earlier Developer‑Workstation Vulnerability (July 2025)
What happened
- A prior Gemini CLI flaw allowed silent malicious command execution on developer machines via:
- Prompt injection
- Weak command‑whitelist parsing
- Terminal UI rendering tricks that hid malicious payloads
Status
- Classified as P1/S1
- Fixed in Gemini CLI v0.1.14 (July 25, 2025)
Why This Matters
- Gemini CLI commonly runs with trusted contributor privileges inside CI/CD pipelines.
- Automatic trust + agent execution = high‑value supply‑chain attack surface.
- This vulnerability class does not rely on AI model behavior—it is infrastructure‑level execution, making it highly reliable for attackers.
Security researchers emphasized that AI coding agents now sit directly in the software supply chain, magnifying the blast radius of configuration and trust failures.
Recommended Actions (Immediate)
- Upgrade immediately
@google/gemini-cli >= 0.39.1run-gemini-cli >= 0.1.22
- Do not process untrusted inputs without explicit workspace trust controls
- Avoid
--yoloor tightly restrict allowlisted commands - Audit CI workflows for implicit trust assumptions
- Rotate any secrets exposed to vulnerable runs
