Claude’s File API enables up to 30 MB data exfiltration via prompt injection
An attacker can exfiltrate up to 30 MB of a user’s data from Claude by using the Files API with a malicious prompt.
Security & privacy Embrace The Red 28 Oct 2025 Attack Prototype evidence
Published as “Claude Pirate: Abusing Anthropic's File API For Data Exfiltration”
Why it matters
This shows that Claude’s default network egress can be leveraged to steal confidential user data, contradicting assumptions about its safety.
Summary
The researchers built an indirect prompt-injection payload that reads a user’s chat history, writes it to a file in Claude’s Code Interpreter sandbox, and then calls Anthropic’s Files API to upload the file using the attacker’s API key. They demonstrated that the Files API can transfer up to 30 MB per file, allowing bulk exfiltration. The attack succeeded in a live demo, though Claude sometimes blocked the payload unless mixed with benign code. Evidence consists of a narrated video and screenshots of the end-to-end flow.
What they found 1
- An attacker can upload a file from the sandbox to their own Anthropic account, exfiltrating up to 30 MB of data.
“With this technique an adversary can exfiltrate up to 30MB at once according to the file API documentation, and of course we can upload multiple files.”
Caveats 6
- Claude would refuse the prompt injection payload.
- Especially having a clear text API key inside the payload was something it didn’t like and thought was suspicious!
- The exploit sometimes fails unless mixed with benign code.
- Reproducibility was inconsistent; later attempts did not work reliably.
- Requires the attacker to possess a valid Anthropic API key.
- File size limited to 30 MB per upload by the Files API.
What’s new here 4
- Shows that Claude’s default “package manager only” egress permits arbitrary file uploads to an attacker’s account.
- Demonstrates an indirect prompt-injection chain that reads user data and uploads it via the Files API.
- Quantifies the exfiltration limit as 30 MB per file according to the API documentation.
- Highlights the need to blend malicious code with benign statements to bypass Claude’s content filters.