IncidentCoding assistants
Claude Code auto mode: a web page summary turns into code execution
Johann Rehberger showed that asking Claude Code in auto mode to summarize a web page could end in arbitrary code execution: the page steered the agent from WebFetch to curl, delivered a ZIP with a malicious struct.py, and when the agent wrote its own decoder, Python's module shadowing ran the attacker's file on import. The chain worked in roughly 60 to 80 percent of runs. Anthropic closed the report as Informative, saying auto mode's classifier is a convenience with best-effort protection and that OS isolation and network controls are the security boundary.
Replay the attack step by step in the Learning Center
How it happened
- An HTTP 415 response made the agent switch from its built-in fetch tool to curl.
- The download was a ZIP containing encoded files plus a struct.py that shadowed the standard library module.
- The agent wrote a decoder, imported struct, and ran the attacker's code; the classifier had approved each step as routine.
Impact
Code execution on a developer's machine from a single untrusted web page, with the agent's full permissions.
The fix
Anthropic shipped no fix for the chain; run the agent in a container or VM with restricted egress, keep credentials out of its reach, and do not treat auto mode approval as evidence a command is safe.
Lessons
- An approval classifier is not a sandbox; plan for it to be wrong some of the time.
- Untrusted content plus a shell is the whole attack; isolation is what bounds the damage.