Skip to content
Info disclosure Write-up Beginner

How To Leak A 340b Secret The Anthropic Claude Code Incident

Anthropic published an npm package that included a source map containing the full original source code of the project. Anyone who downloaded the package could read the proprietary code and learn about unreleased features.

Yuvarajan Follow

Published on infosecwriteups.com

I genuinely thought this was an April Fool’s prank. Every year, companies like Google pull some elaborate stunt, so when I saw the “Claude Code leak” trending on April 1st, I kept scrolling.

Yuvarajan, on infosecwriteups.com

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 the build process included a source map with the sourcesContent field in the published npm package, exposing the full source code.

Impact

Anyone who downloaded the package could read the proprietary source code and learn about unreleased features, and the code was quickly mirrored elsewhere.

What the attacker needed

None

The fix

The package was removed from npm, but the text suggests configuring the build pipeline to avoid publishing source maps with sourcesContent.

How it was found

  1. Notice the unusual file size of the npm package.
  2. Download the package from npm.
  3. Extract the source map file from the package.
  4. Read the original source code from the sourcesContent field.

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.

When developers ship code, they often shrink it to save space, which makes it unreadable. A source map is a helper file that lets developers see the original readable code when debugging. Here, the source map accidentally included the full original code, so anyone who downloaded the package could read it.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Yuvarajan

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.