Claude Pirate: abusing the Anthropic File API for data exfiltration
Claude Pirate: Abusing Anthropic's File API For Data Exfiltration
Researchers disclosed a data exfiltration attack chain targeting Claude Code Interpreter: exploiting the default-enabled network egress whitelist that includes api.anthropic.com, using indirect prompt injection to make Claude read user data and write it to sandbox files, then using the attacker's own ANTHROPIC_API_KEY to call the Anthropic Files API to upload the files to the attacker's account. According to the Files API documentation, up to 30MB can be exfiltrated in a single request, and uploads can be repeated. The author said the first attempt succeeded, but afterward Claude would reject payloads containing plaintext API keys, and the bypass was ultimately achieved by mixing a large amount of harmless code (such as print('Hello, world')) into the malicious code.
The author tested the data exfiltration chain under Claude Code Interpreter's default network egress configuration, and provided mitigation recommendations for both the vendor and user sides.