# CVE-2026-12537: Unauthenticated Remote Code Execution in Gemini CLI CI/CD Workflows

> An unauthenticated attacker can execute arbitrary code on the host by exploiting improper neutralization in the container launcher via a malicious .env file.

- **Severity:** Critical 10.0 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/U:Clear`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Jun 2026
- **Updated:** 24 Jun 2026
- **Also known as:** GHSA-wpqr-6v78-jr5g, MINI-78jg-xhr8-46rq

## What is CVE-2026-12537?

CVE-2026-12537 is a critical command injection vulnerability in Google Cloud Gemini CLI, published on 24 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Improper Neutralization used in an OS Command in the container launcher in Google Gemini CLI (versions prior to 0.39.1) and run-gemini-cli GitHub Action (versions prior to 0.1.22) on headless CI platforms allows an unprivileged attacker to achieve pre-sandbox host-level code execution a maliciously crafted .gemini/.env file.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2026-12537?

5 open source packages ship an affected version, including @google/gemini-cli and google-github-actions/run-gemini-cli. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@google/gemini-cli` | npm | All versions | 0.39.1 |
| `@google/gemini-cli` | npm | All versions | 0.39.1 |
| `@google/gemini-cli` | npm | From 0.40.0-preview.2 | 0.40.0-preview.3 |
| `@google/gemini-cli` | npm | From 0.40.0-preview.2 | 0.40.0-preview.3 |
| `google-github-actions/run-gemini-cli` | GitHub Actions | All versions | 0.1.22 |

Products: Google Gemini-Cli, Google Run-Gemini-Cli.

## How do I fix CVE-2026-12537?

Upgrade @google/gemini-cli to a fixed version for your release line: 0.39.1 or 0.40.0-preview.3.

## Is CVE-2026-12537 being exploited?

There is no known exploitation of CVE-2026-12537 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-12537 and fix it if it is affected.

What it is: CVE-2026-12537 is a critical command injection vulnerability in Google Cloud Gemini CLI, published on 24 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-12537 in the wild and no public exploit code.

Affected packages and fixed versions:
- @google/gemini-cli (npm): affected all versions; fixed in 0.39.1
- @google/gemini-cli (npm): affected all versions; fixed in 0.39.1
- @google/gemini-cli (npm): affected from 0.40.0-preview.2; fixed in 0.40.0-preview.3
- @google/gemini-cli (npm): affected from 0.40.0-preview.2; fixed in 0.40.0-preview.3
- google-github-actions/run-gemini-cli (GitHub Actions): affected all versions; fixed in 0.1.22

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-12537/ (Markdown: https://insights.sbomify.com/CVE-2026-12537/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-12537
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-12537
- OSV: https://osv.dev/vulnerability/CVE-2026-12537

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-12537/
Summaries are generated and may contain mistakes; the official description above is the record.
