Bun Runtime Bug May Have Exposed Claude Code Source in Recent Leak
Key Takeaways
- ▸A Bun runtime bug incorrectly serves source maps in production environments despite being disabled
- ▸Source map exposure can reveal sensitive code structure, variable names, and logic to potential attackers
- ▸The vulnerability may have contributed to the recent Claude Code source code leak incident
Summary
A critical bug in the Bun JavaScript runtime may have been responsible for inadvertently exposing Anthropic's Claude Code source code in a recent security incident. The bug causes source maps to be incorrectly served in production mode despite being explicitly disabled in the configuration, potentially exposing sensitive code structure and logic. Source maps, which map minified or bundled code back to its original source, are typically disabled in production environments for security and performance reasons. The issue was reported on Bun's GitHub repository (issue #28001), describing how source maps continue to be served even when the development: false flag is explicitly set.
- The bug affects Bun's bundler and fullstack development server functionality
Editorial Opinion
This incident highlights a critical gap between configuration expectations and actual runtime behavior in build tools and runtimes. Even when developers explicitly set security-conscious defaults like disabling source maps in production, implementation bugs can silently override those protections. It underscores the importance of security audits and automated testing for build tool configurations, as well as the responsibility of tool maintainers to ensure security settings work as documented.



