{"id":7657,"date":"2026-04-01T02:15:55","date_gmt":"2026-04-01T02:15:55","guid":{"rendered":"https:\/\/cybersecurityinfocus.com\/?p=7657"},"modified":"2026-04-01T02:15:55","modified_gmt":"2026-04-01T02:15:55","slug":"anthropic-employee-error-exposes-claude-code-source","status":"publish","type":"post","link":"https:\/\/cybersecurityinfocus.com\/?p=7657","title":{"rendered":"Anthropic employee error exposes Claude Code source"},"content":{"rendered":"<div>\n<div class=\"grid grid--cols-10@md grid--cols-8@lg article-column\">\n<div class=\"col-12 col-10@md col-6@lg col-start-3@lg\">\n<div class=\"article-column__content\">\n<div class=\"container\"><\/div>\n<p>An Anthropic employee accidentally exposed the entire proprietary source code for its AI programming tool, Claude Code, by including a source map file in a version of the tool posted on Anthropic\u2019s open npm registry account, a risky mistake, says an AI expert.<\/p>\n<p>\u201cA compromised source map is a security risk,\u201d said US-based cybersecurity and AI expert <a href=\"https:\/\/josephsteinberg.com\/cybersecurityexpertjosephsteinberg\/\" target=\"_blank\" rel=\"noopener\">Joseph Steinberg<\/a>. \u201cA hacker can use a source map to reconstruct the original source code and [see] how it works. Any secrets within that code \u2013 if someone coded in an API key, for example \u2013 is at risk, as is all of the logic. And any vulnerabilities found in the logic could become clear to the hacker who can then exploit the vulnerabilities.\u201d<\/p>\n<p>However, Anthropic spokesperson told <em>CSO<\/em>, \u201cno sensitive customer data or credentials were involved or exposed. This was a release packaging issue caused by human error, not a security breach. We\u2019re rolling out measures to prevent this from happening again.\u201d<\/p>\n<p>But it wasn\u2019t the first time this had happened; <a href=\"https:\/\/fortune.com\/2026\/03\/31\/anthropic-source-code-claude-code-data-leak-second-security-lapse-days-after-accidentally-revealing-mythos\/\" target=\"_blank\" rel=\"noopener\">according to Fortune<\/a> and other news sources, the same thing happened last month.<\/p>\n<h2 class=\"wp-block-heading\">Don\u2019t expose .map files<\/h2>\n<p>Map files shouldn\u2019t be left in the final version of code published on open source registries, where anyone can download a package; they can be sources of useful information for hackers.<\/p>\n<p>According to developer Kuber Mehta, <a href=\"https:\/\/kuber.studio\/blog\/AI\/Claude-Code's-Entire-Source-Code-Got-Leaked-via-a-Sourcemap-in-npm,-Let's-Talk-About-it\" target=\"_blank\" rel=\"noopener\">who published a blog on the latest incident<\/a>, when someone publishes a JavaScript\/TypeScript package to npm, the build toolchain often generates\u00a0source map files\u00a0(.map\u00a0files). These files are a bridge between the minified\/bundled production code and the original source; they exist so that when something crashes in production, the stack trace can point to the\u00a0<em>actual<\/em>\u00a0line of code in the\u00a0<em>original<\/em>\u00a0file, not to some unintelligible reference.<\/p>\n<p>What\u2019s available in these files? \u201cEvery file. Every comment. Every internal constant. Every system prompt. All of it, sitting right there in a JSON file that npm happily serves to anyone who runs\u00a0npm pack\u00a0or even just browses the package contents,\u201d said Mehta.<\/p>\n<p>\u201cThe mistake is almost always the same: someone forgets to add\u00a0*.map\u00a0to their\u00a0<em>.npmignore<\/em>\u00a0or doesn\u2019t configure their bundler to skip source map generation for production builds,\u201d Mehta said. \u201cWith Bun\u2019s bundler (which Claude Code uses), source maps are generated by default unless you explicitly turn them off.\u201d<\/p>\n<p>Think of a source map as a file that shows what parts of minified computer code, which is not easily understandable to humans, are doing, shown in the human-readable source code, said Steinberg. For example, he said, it may indicate that the code in a specific portion of the executable code is performing the instructions that appear in some specific snippet of source code.<\/p>\n<p>A source map can help with debugging, he added. Without it, he said, many errors would be identified as coming from a larger portion of code, rather than showing exactly where the errors occur.<\/p>\n<p>The world learned of this incident when security researcher Chaofan Shou <a href=\"https:\/\/x.com\/Fried_rice\/status\/2038894956459290963?ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener\">posted this message early Tuesday on X<\/a>: \u201cClaude code source code has been leaked via a map file in their npm registry!\u201d, along with a link to the file.<\/p>\n<h2 class=\"wp-block-heading\">A common error<\/h2>\n<p>Leaving source map files in a package \u201cis an incredibly common mistake developers make quite often,\u201d said secure coding trainer <a href=\"https:\/\/shehackspurple.ca\/\" target=\"_blank\" rel=\"noopener\">Tanya Janca<\/a>. \u201cIn this specific situation, it is more serious than it would be somewhere else, mostly because of the incredibly high value of the intellectual property involved, and because now malicious actors can analyze the source code directly for vulnerabilities instead of having to reverse engineer it, which adds time, cost, and complexity.\u201d<\/p>\n<p>Ideally, Janca said, developers should harden their build environment, so they don\u2019t ship debug information\/features with production. She offered these tips to developers:<\/p>\n<p>disable source maps in the build\/bundler tool;<\/p>\n<p>add the .maps file to the <em>.npmignore \/ package.json<\/em> files field to explicitly exclude it, even if it was generated during the build by accident;<\/p>\n<p>exclude the .maps files from the list of published artifacts in the continuous integration\/continuous deployment environment;<\/p>\n<p>carefully separate debug builds from production builds if there are differences; even the comments could be incredibly sensitive.<\/p>\n<h2 class=\"wp-block-heading\">A critical layer<\/h2>\n<p>Any exposure of source code or system-level logic is significant, because it shows how controls are implemented, commented <a href=\"https:\/\/arcticwolf.com\/resources\/author\/dan-schiappa\/\" target=\"_blank\" rel=\"noopener\">Dan Schiappa<\/a>, president of technology and services at Arctic Wolf. With this information exposed, the number of people who now understand how the model enforces behavior, manages access, and handles edge cases increases, he said.<\/p>\n<p>\u201cIn AI systems, that layer is especially critical,\u201d he added. \u201cThe orchestration, prompts, and workflows effectively define how the system operates. If those are exposed, it can make it easier to identify weaknesses or manipulate outcomes. Knowing that attackers are still discovering the most optimal ways to leverage AI means that in any instance where a tool could be compromised, there are likely cybercriminals waiting in the wings.\u201d<\/p>\n<p><em>This article originally appeared on <a href=\"https:\/\/www.infoworld.com\/article\/4152856\/anthropic-employee-error-exposes-claude-code-source.html\" target=\"_blank\" rel=\"noopener\">InfoWorld<\/a>.<\/em><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>An Anthropic employee accidentally exposed the entire proprietary source code for its AI programming tool, Claude Code, by including a source map file in a version of the tool posted on Anthropic\u2019s open npm registry account, a risky mistake, says an AI expert. \u201cA compromised source map is a security risk,\u201d said US-based cybersecurity and [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":7658,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-7657","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-education"],"_links":{"self":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts\/7657"}],"collection":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7657"}],"version-history":[{"count":0,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts\/7657\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/media\/7658"}],"wp:attachment":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}