windows-safe-grep

Fail

Audited by Gen Agent Trust Hub on Feb 16, 2026

Risk Level: HIGHCOMMAND_EXECUTIONPROMPT_INJECTION
Full Analysis
  • [Indirect Prompt Injection] (HIGH): The safe-grep.sh script reads contents from files and outputs them to the agent's context. This is a primary vector for indirect prompt injection where malicious instructions inside a scanned file could hijack the agent's behavior.
  • Ingestion points: The script reads file contents via the grep command in safe-grep.sh.
  • Boundary markers: None. The output is directly returned without delimiters or instructions to ignore embedded commands.
  • Capability inventory: Executes filesystem searches (find) and file reads (grep).
  • Sanitization: No sanitization of the file content is performed before returning it to the agent.
  • [Command Execution] (MEDIUM): The script is vulnerable to argument injection in both the find and grep calls.
  • Evidence: In safe-grep.sh, the variables $WIN_PATH and $SEARCH_PATTERN are passed to commands without using the -- delimiter.
  • Impact: If an attacker can control the path or search pattern (e.g., via a malicious project configuration), they could inject flags like -delete into the find command or other functional flags into grep to manipulate execution behavior.
Recommendations
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Feb 16, 2026, 05:58 AM