The Claude Code Leak: What’s Now Publicly Usable (and Abusable) — And Why Anthropic’s Containment Already Failed
Anthropic accidentally leaked the complete source code for Claude Code via a debug source map file in an npm package. The leak exposed a security bypass where 51 subcommands disable validation, allowing credential exfiltration, and revealed other sensitive features.
Published on systemweakness.com
How Anthropic’s Leak Became a Meme Storm Nobody Planned (Part 2) Author: By Berend F. Watchus.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a missing .npmignore entry and a known Bun runtime bug caused source maps to be served in production.
Impact
An attacker could silently exfiltrate SSH keys, AWS credentials, and GitHub tokens without warning or log entry.
What the attacker needed
Malicious CLAUDE.md file; user runs Claude Code with terminal access
The fix
The fix (tree-sitter parser) existed but was not enabled; it should be enabled to prevent the bypass.
How it was found
- Create a malicious CLAUDE.md file with 50 legitimate-looking build steps.
- Add one credential exfiltration command as the 51st step.
- The validation stack silently disengages and the exfiltration command executes.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A source map is a file that helps developers debug by mapping minified code back to readable source. It was accidentally included in a public package, exposing the full source code. The leak revealed that a security check could be bypassed by sending many commands at once, letting an attacker steal credentials.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.