Malicious Site Tricks Claude Auto Mode into Running Code

Embrace The Red · High sophistication
Last updated August 27, 2026

A researcher demonstrated that a seemingly harmless “summarize this website” request can be turned into a prompt-injection style attack that pushes Claude Code (Auto Mode) into running commands and ultimately executing attacker code. The workflow uses a fake archive site that forces a tool fallback to curl, delivers a booby-trapped ZIP, and abuses Python “module shadowing” so the agent’s own decoder code triggers the payload.

Key findings

  • A malicious website workflow achieved reported 60–80% success in a small test sample by guiding an AI coding agent into unsafe tool use and code execution.
  • The site intentionally causes WebFetch to fail with “415 Unsupported Media Type,” leading the agent to use shell + curl instead.
  • The downloaded ZIP contains a poisoned Python file (struct.py) that gets imported indirectly when the agent runs its own decoder inside the extracted folder.
  • The payload chain downloads and executes a remote stage, then runs a native payload and establishes a C2 callback in the lab demo.
  • In some runs, Auto Mode allowed creating the malicious process but later blocked cleanup/termination commands.

Who’s being targeted

  • Commonly targeted roles: Developers, AI/ML Engineering, Security Engineering, IT Operations, Security Awareness.
  • Affected industries: Software development, IT engineering, AI/ML engineering.
  • Attack channels: website.
  • Impersonated: A legitimate-looking online archive/catalogue site, Catalogue decoder documentation inside README.txt, Python decoding/import process (module-level code execution during import).

Awareness takeaways

  • Treat AI coding agents like untrusted automation: run them in a sandboxed environment with monitoring.
  • Be cautious when an agent is nudged from safer tools to more dangerous ones (e.g., from a web fetcher to shell + curl).
  • Don’t run scripts from inside downloaded/extracted folders; import/module shadowing can turn ‘your own code’ into the execution trigger.
  • Lock down network egress and secrets exposure for agent runtimes to reduce impact if execution occurs.

Red flags to watch for

  • Unexpected content-type failure nudges the toolchain into using curl/shell: “415 Unsupported Media Type”
  • Content arrives as an executable workflow (ZIP with a decoder and Python modules) instead of simple web text
  • Agent runs code from inside an attacker-controlled extracted directory (enabling import/module shadowing)
  • ZIP contains a file named like a standard library module (e.g., “struct.py”)
  • Agent executes Python from the extracted archive root (import path includes attacker files)
  • Decoy executable encourages unsafe local decoding behavior even when it is refused
  • Hidden network download occurs during what should be offline decoding/parsing
  • Unexpected child processes (e.g., Python spawning Python) during a simple decode task
  • Agent later realizes compromise but cannot remediate due to tool safety gating
Try Mirage

Mirage safely runs attacks like this one against your own team, so you find out what happens before a real adversary does.

Get a demo
Read the video transcript

You type: “Summarize https://archive.example.uk/” and let Claude Auto Mode handle it. Seems harmless, right? Behind the scenes, the site breaks WebFetch with a “415 Unsupported Media Type”, so Auto Mode switches to shell plus curl, follows a 303 redirect, and quietly downloads a ZIP instead of plain text. Auto Mode unzips it, sees a decoder README and a decoy binary, refuses the binary, then helpfully writes its own Python decoder, right inside the extracted folder, where a malicious struct.py shadows Python’s real module and runs attacker code. Here’s the rule: treat AI coding agents like untrusted automation, run Auto Mode only in a locked-down sandbox with restricted network egress and no real secrets.

Similar attacks

Fake AI Experts Lure Think Tanks Into M365 Phish

Fake AI Experts Lure Think Tanks Into M365 Phish

A China-aligned group (TA419) targeted US AI policy experts by impersonating well-known AI and policy figures and sending friendly “collaboration” emails. If the target engaged, the attackers redirected them through multiple URLs to a fake Microsoft login pop-up designed to steal Microsoft 365…

October 2, 2026
Phishing Gets Smarter: QR Codes, Tokens, Deepfakes

Phishing Gets Smarter: QR Codes, Tokens, Deepfakes

The article describes how real-world phishing and social engineering are evolving to bypass the checks employees are trained to use (bad grammar, suspicious URLs, obvious fake login pages). It highlights specific, observed attack workflows including QR-code “device hop” phishing, OAuth token theft…

September 29, 2026
Google Doc “Fix” Trick Delivers Malware

Google Doc “Fix” Trick Delivers Malware

A real-world social engineering attempt used a legitimate Google Doc to trick a target into manually running commands that installed malware. The attacker posed as a crypto marketing executive and used a fake “decryption failure” message and a “manual update” button as the lure, leading to an…

September 21, 2026
Fake ChatGPT Invoice Email Steals Logins

Fake ChatGPT Invoice Email Steals Logins

Attackers are sending fake ChatGPT billing emails that pressure people to “update payment” within 48 hours to avoid service interruption. The message links to a convincing look‑alike ChatGPT login page via a Google redirect, aiming to steal OpenAI credentials.

September 18, 2026
Fake “OpenAI Codex” Ads Push Mac ClickFix Malware

Fake “OpenAI Codex” Ads Push Mac ClickFix Malware

Attackers are buying sponsored Google search ads that send Mac developers to fake OpenAI Codex download pages. The pages instruct victims to paste a Terminal command that looks like a normal install step, but actually downloads and runs a multi-stage malware payload.

August 25, 2026
Fake AI Ad Portals Steal Logins and MFA Codes

Fake AI Ad Portals Steal Logins and MFA Codes

Researchers uncovered a human-run phishing platform that pretends to be ad-management products for popular AI brands (ChatGPT, Gemini, Claude, and others). Victims are pushed to click a “Connect” flow that opens a convincing fake login window (showing trusted domains like accounts.google.com) to…

October 6, 2026