← All incidents timeline

Suggest a change

About Claude Code auto mode runs attacker code via module shadowing

Suggest a change to an entry, the methodology or the ledger as a whole: something to fix, correct or add. We read every suggestion, and check corrections against their sources.

Anthropic· Claude Code, Opus 5 in auto mode

Claude Code auto mode runs attacker code via module shadowing

Asked to summarise a researcher's web page, Claude Code in auto mode switched to curl, pulled a ZIP archive, wrote and ran its own Python decoder inside the extracted folder, and loaded a planted struct.py that ran the attacker's code.

Johann Rehberger (Embrace The Red) published on 26 August 2026 an attack chain against Claude Code running Opus 5 in auto mode. A web page returned HTTP 415 to WebFetch, so Claude decided to fetch it with curl in bash. The server redirected to a ZIP of encoded notebook records plus a decoder binary and a malicious struct.py. Claude refused to run the supplied binary but wrote its own Python decoder and ran it from the extracted directory; importing base64 pulled in struct, which Python resolved to the attacker's file. The payload started an isolated Python subprocess that fetched a remote stage, set up C2 callbacks and opened Calculator; another variant launched a second headless Claude Code. In some runs Claude noticed the compromise and tried to clean up, and auto mode denied the cleanup command. Reported success was 60 to 80 percent across small samples of five runs per variant. Anthropic closed the report as Informative, saying auto mode is a best-effort classifier, not a security guarantee, and that the boundary is OS isolation and egress control. The work came three weeks after Anthropic published a vendor evaluation with no successful attacks in 720 attempts against auto mode, and twelve days after auto mode became the default on 14 August 2026.

First incident action to disclosure
Unknown
First incident action to discovery
Not disclosed
Noticed first by
Someone else
Caught
An outside report

What happened

  • First incident action
  • Unnoticed
  • Handler found out
  • Known, not public
  • Disclosed
  • Public
  1. Not disclosed

    First incident action

    Researcher runs the chain against Claude Code with Opus 5 in auto mode

    Asked to summarise a site; after an HTTP 415 on WebFetch, Claude switched to curl, followed a 303 redirect to a ZIP, wrote its own decoder and ran it in the extracted folder, loading the planted struct.py. Three variants, five runs each, 60 to 80 percent success. Not dated.

  2. Not disclosed

    Payload fetches a remote stage, sets up C2, or spawns a headless Claude Code

    Variants: python3 -I stager with native payload and C2; a nested claude -p running recon; file writes outside the workspace. In some runs auto mode denied Claude's own cleanup command.

  3. Not disclosed

    Report sent to modelbugbounty@anthropic.com, no response

  4. Not disclosed

    Report resubmitted through Anthropic's security reporting channel

    Rehberger says he heard back quickly.

  5. Not disclosed

    Anthropic closes the report as Informative, working as designed

    Auto mode described as a convenience feature backed by a best-effort classifier; the boundary is OS isolation and egress control.

  6. 26 Aug 2026

    Disclosed

    Embrace The Red publishes "Breaking Claude Code Opus 5 Auto Mode"

  7. 27 Aug 2026

    Simon Willison writes it up

  8. 28 Aug 2026

    The Register reports; Anthropic does not reply to its comment request

    Reported
  9. 31 Aug 2026

    GovInfoSecurity reports the attack and Anthropic's guidance

    Reported
  10. 1 Sep 2026

    Tech Times reports no fix is planned

    Reported

Agent failures

Prompt injection / context poisoning, Untrusted code executionShow
Map to frameworks
  • Prompt injection / context poisoning

    A researcher's web page led it to download and unpack an archive.

  • Untrusted code execution

    Loaded a planted struct.py that ran the attacker's code.

How it was found

Found first by someone else, from an outside reportShow
Found first by
Someone else
How
An outside report
Found to disclosed
Not disclosed

This is deliberate vulnerability research, not an agent acting unprompted in the wild. The researcher built the malicious site and archive and observed the resulting actions (curl download, extraction, decoder run, payload execution) on his own machine. No victim or in-the-wild exploitation is reported.

What is publicly known

5 of 12 fully publicShow
5 of 12 fully public
ItemPublic?DetailSources
PartialClaude Code running Opus 5; no model id or Claude Code version given.
UnknownThe post does not mention thinking or effort settings.
KnownAuto mode, the default since 14 August 2026, a classifier approving commands; no other permission setting described.
UnknownNo system prompt or custom configuration disclosed.
KnownThe prompt is given: summarise a named archive site, domain partly redacted.
PartialClaude Code with WebFetch and Bash, using curl and Python. Claude Code version not stated.
WeakTest endpoint served content only to allow-listed IPs; the test machine's egress setup is not described.
PartialScreenshots and an end-to-end video; no full session log.
KnownResearcher observed effects directly: Calculator launched, C2 callback, nested Claude Code. Success rates per variant given.
PartialResearcher's own machine only; no in-the-wild victims reported. Exposure to other auto mode users not measured.
KnownClassifier sees only the short decoder, not the multi-hop chain; module shadowing via a planted struct.py.
KnownAnthropic closed the report as Informative, working as designed; no fix planned.

Controls that apply

  • Govern

    Vet, pin and change-control what agents load

    A Python run whose working directory held a planted struct.py, which took the place of the standard-library module when the agent's own decoder imported base64.

  • Protect

    Treat what the agent reads as untrusted

    The page Claude was asked to summarise answered WebFetch with HTTP 415 and redirected curl to a ZIP of encoded records with a decoder and a planted struct.py. Treated as data, that response would not on its own have led to a download, an extraction and a code run.

  • Isolate where the agent runs

    The payload wrote files outside the workspace and started its own Python process. A container with a filesystem limited to the task would have kept that inside it and raised the writes outside; Anthropic's reply names OS isolation as the boundary.

  • Limit where the agent can send traffic

    A subprocess fetching a remote stage, then callbacks to the attacker's command-and-control host. An allowlist would have refused both and raised the blocked attempts; Anthropic also points to egress control as the boundary.

  • Check each action against policy before it runs

    Auto mode's classifier let through the curl download, the extraction and a decoder run inside the extracted folder, then denied Claude's own cleanup. A deterministic check would have held a Python run in a directory just filled from an untrusted archive.

  • Detect

    Record every agent action, outside the agent

    The switch from WebFetch to curl after the 415, the ZIP downloaded and extracted into the working directory, the decoder run, and a second headless Claude Code started from a Python process rather than by the user.

  • All controls →

Coverage and commentary

3 statements, 4 articlesShow

What the parties involved said

  • Johann Rehberger

    Auto mode approval is not evidence a command is safe; run agents in containers, VMs or OS sandboxes, restrict egress, keep credentials out of reach and monitor agent activity. Contrasts his result with the 0.00% figure Boris Cherny shared.

  • Anthropic (as quoted by Rehberger)

    Closed the report as Informative and working as designed: auto mode is a convenience feature on a best-effort classifier, determined chains of benign-looking steps are not what it aims to stop, and the real boundary is OS isolation and egress control.

  • Anthropic

    When making auto mode the default, stated that it relies on classifiers and does not eliminate risk, and recommended manual review for high-stakes production changes.

All 6 sources
  1. Primary source

    Breaking Claude Code Opus 5 Auto Mode ↗Embrace The Red · 2026-08-26

  2. Primary source

    Auto mode is now the default in Claude Code for Pro, Max, and Team plans ↗Anthropic · 2026-08-07

  3. Press

    Researcher shows how Claude Code can be tricked simply by asking it to summarize a website ↗The Register · 2026-08-28

  4. Press

    Hidden Attack Slips Past Claude Code Auto Mode ↗GovInfoSecurity (ISMG) · 2026-08-31

  5. Press

    Summarizing Website in Claude Code Auto Mode Can Compromise Your Machine; No Fix Planned ↗Tech Times · 2026-09-01

  6. Commentary

    Breaking Claude Code Opus 5 Auto Mode ↗Simon Willison's Weblog · 2026-08-27

Entry id anthropic-claude-code-automode-rce-2026 · overall Confirmed · impact contained