Documented incidentPublished 2025-07-28Google Gemini CLI usersResearch paper

Prompt injection in a README plus weak allow-list matching lets Gemini CLI silently run attacker commands (2025)

Researchers hid a prompt injection inside a README.md (in the text of a software license) so that Gemini CLI, asked only to inspect a codebase, would request shell commands.

What happened

  • Users can allow-list a command such as grep for the session; Gemini CLI matched commands against that list too loosely, so "grep" followed by a second, malicious command was treated as allowed and ran without asking.Code Execution Through Deception: Gemini AI CLI Hijack
  • The demonstrated command silently sent the user's environment variables, which may contain secrets, to an attacker; Google rated it P1/S1 and fixed it in v0.1.14 on July 25, 2025.Code Execution Through Deception: Gemini AI CLI Hijack

The failure pattern

Watch the pattern: Indirect prompt injection changes agent behavior

Safeguards that address it

CollectSEA's engineering analysis of what would have prevented or contained this failure.

  • Match allow-listed commands exactlyParse the full command, including chained and piped commands, before treating it as pre-approved.
  • Show the user exactly what will runDisplay the complete command text for any execution request and never hide output that an agent produced from untrusted content.

Related standards

CollectSEA's mapping through this incident's failure pattern; not an official determination by the standards bodies.

Building something similar?

Describe your design and see every precedent that applies, with safeguards you can hand to your coding agent.

Analyze your design
Security advisory2026-11-27AI agent

Bagel (bagel-mcp) issue could allow unintended commands to run

Bagel (bagel-mcp) before 2.5.5 contains an argument injection vulnerability in RsyncFilesToLocalDirectory that allows attackers to inject rsync options because only --quiet and --log-format values are rejected.

Indirect prompt injection changes agent behaviornvd.nist.gov
Security advisory2026-11-27AI agent

WhoDB issue could allow unauthorized access

WhoDB from 0.88.0 before 0.132.0 contains an access control bypass in the MCP whodb_query tool, letting callers run file-writing statements without approval because the sqlguard keyword classifier omits INTO, OUTFILE and…

Indirect prompt injection changes agent behaviornvd.nist.gov