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 “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 SSO + MFA Push Used in Real Breaches

Fake SSO + MFA Push Used in Real Breaches

This weekly roundup includes two real social-engineering-driven incidents. Attackers used social engineering to access Apollo Global Management’s cloud platforms and steal sensitive personal data, and separately attempted a ShinyHunters phishing attack against ReliaQuest using a fake SSO login page…

August 28, 2026
Fake Bank Calls and ClickFix Drive Data Theft

Fake Bank Calls and ClickFix Drive Data Theft

The roundup describes multiple real-world attacks where criminals manipulate people, not just systems, such as fake bank support calls that trick victims into installing phone malware, and “ClickFix” lures that convince Mac users to run malicious commands. It also highlights an AI-assisted…

August 21, 2026
Fake Claude & Perplexity Lures Push Malware

Fake Claude & Perplexity Lures Push Malware

Sophos reports real incidents where attackers impersonated well-known AI brands (especially Claude) to trick people into installing malware. The lures included polished fake installer pages that instruct victims to copy/paste commands, and browser extensions that look legitimate via high ratings…

August 21, 2026
Encrypted Web Page Trick Leaks Grok Chat Data

Encrypted Web Page Trick Leaks Grok Chat Data

Researchers demonstrated a technique that can trick xAI’s Grok into leaking a user’s chat prompts and some session details to an attacker-controlled server when the user asks Grok to summarize a web page. The attack hides malicious instructions inside encrypted content on the page, which Grok is…

August 20, 2026
Job Offer & Doc-Link Phishing Drive Real Breaches

Job Offer & Doc-Link Phishing Drive Real Breaches

This weekly threat bulletin describes real incidents where attackers used human manipulation to break in, including social engineering at Levi Strauss and a Microsoft 365 credential-theft phish at defense supplier IEH. It also highlights a Lazarus-linked campaign using fake job offers and…

August 17, 2026