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-10-16AI system

Software component issue could allow unintended commands to run

The The Slim SEO – AI SEO Plugin, Lightweight, Fast & Automated plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 4.11.1 This is due to the software allowing users…

Indirect prompt injection changes agent behaviornvd.nist.gov
Security advisory2026-10-16AI agent

Software component issue could allow unintended commands to run

The DoubleScale | All-in-One CRM – Sales, Multi-Channel Marketing, Newsletter, Booking, Helpdesk, Automation, MCP & More plugin for WordPress is vulnerable to Arbitrary File Upload in all versions up to, and including,…

Indirect prompt injection changes agent behaviornvd.nist.gov