← All advisories

CVE-2026-142216highAgent hijacking2026-12-02

CVE-2026-142216: gemini-mcp-tool passes the model parameter straight to Gemini CLI, so a prompt-injected agent can slip in --yolo and auto-approve commands on the host (1.1.8, no fix yet)

gemini-mcp-tool (npm, jamubc/gemini-mcp-tool) is an MCP server that lets Claude Code and other agents hand work to Google's Gemini CLI. Its executeGeminiCLI() puts the tool's model argument on the Gemini CLI command line as given. If an attacker can steer the calling agent, for example with prompt injection in a file or web page, the agent can pass a value like --yolo to ask-gemini or brainstorm. Gemini CLI then auto-approves its own shell commands and file edits on the host. VulnCheck rates it 7.7 and lists 1.1.8, the latest npm release, as affected.

01.

What it is

In src/utils/geminiExecutor.ts (v1.1.8), executeGeminiCLI() builds the argument list with args.push(CLI.FLAGS.MODEL, model). Nothing checks that model is a real model name or that it does not start with --.

Gemini CLI reads --yolo as a flag that auto-approves all tool actions, including shell commands and file writes.

The MCP tools ask-gemini and brainstorm take model as an argument chosen by the calling LLM. An attacker who can get text into that agent's context (a README, issue, web page or tool output) can ask it to call the tool with model set to --yolo and a prompt that runs commands.

CVE-2026-142216 was published on 2 December 2026, credited to Zachariah Mithani (AploSec). The npm package's latest version is still 1.1.8 (last published June 2026), so there is no fixed release yet.

02.

How to check

  1. Look for gemini-mcp-tool in your MCP client configs (for example claude mcp list, ~/.claude.json, .mcp.json or Cursor's mcp.json).
  2. Check which agents can call it and whether they read untrusted content such as web pages, issues or third-party repos.
  3. Check your Gemini CLI settings and logs for runs in auto-approve (YOLO) mode that you did not start.
03.

How to fix

  1. Remove or disable gemini-mcp-tool until a fixed version is released, or pin it to a fork that only accepts an allowlisted set of model names.
  2. If you keep it, make the client ask for approval on every ask-gemini and brainstorm call so you can see the model argument.
  3. Run Gemini CLI in its sandbox, or in a container without your credentials, so an injected --yolo run cannot reach your real files and keys.
grep -rn 'gemini-mcp-tool' ~/.claude.json .mcp.json ~/.cursor/mcp.json 2>/dev/null
npm view gemini-mcp-tool version   # 1.1.8 is affected
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.