Skip to content
Info disclosure Disclosed report Beginner

Source code leakage due to exposed sourcemap

Source maps were publicly accessible on bitbucket.org, allowing anyone to retrieve the original source code of the Bitbucket Cloud frontend. An attacker could use browser developer tools to list and download the entire codebase.

talkingllama Follow

Originally disclosed on Bugcrowd

Bounty$200 Low View original
  • Accepted in 5 months
  • Disclosed after 8 months

Summary by Atlassian

Source code leakage due to exposed sourcemap in Bitbucket Cloud

Summary by talkingllama

I am proceeding the public disclosure of the steps to reproduce and the source code dump.

Report details

  • Submitted

    21 May 2020 12:21:30 UTC

  • Target Location

    Bitbucket Cloud including Bitbucket Pipelines (https://bitbucket.org)

  • Target category

    Web App

  • VRT

    Automotive Security Misconfiguration > Infotainment > Source Code Dump

  • Priority

    P4

  • Bug URL

    https://bitbucket.org

  • Description

    There is a leakage of source maps due to which entire source code can be dumped from the bitbucket.org site which contains the bitbucket cloud codebase.

    You can use Chrome dev tools to list all the files and dump it.

    I Have attached the entire source code dump below.

The original report as published on Bugcrowd, by Atlassian. Images and videos are our own copies; raw HTML is shown as text. View it on Bugcrowd.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The target is Bitbucket Cloud, including Bitbucket Pipelines, at https://bitbucket.org. The researcher, talkingllama, reported a source code leak caused by an exposed sourcemap. Atlassian's own summary of the issue is short: source code leakage due to an exposed sourcemap in Bitbucket Cloud.

The researcher's description is equally direct. Source maps were being served from the site, and because of that the entire source code behind the bitbucket.org front end, which the report describes as the Bitbucket Cloud codebase, could be dumped. The stated method is to use Chrome DevTools to list all the files and then dump them. The report does not give a specific URL, parameter or request; the only location given is the site root:

Text
https://bitbucket.org

The researcher says a full source code dump was attached to the report, but the attachment is not reproduced here, so the contents of the dump are not described.

The report metadata records the submission on 21 May 2020 at 12:21:30 UTC, the target category as Web App, and the VRT classification as Automotive Security Misconfiguration > Infotainment > Source Code Dump. The priority was P4. The report was disclosed publicly on 22 January 2021, and the bounty was 200.00 USD. The report does not describe a fix.

Root cause

The likely mistake is that production builds were shipped with source maps, and those map files were reachable from the public site. When the map is served publicly, anyone who can load the bundle can also load the map and recover the pre-build source.

Impact

The report's claim is confidentiality loss: the source code of the Bitbucket Cloud front end could be dumped in full. Source disclosure on its own does not give an attacker execution or access, but it shortens reconnaissance considerably. Original file names, directory structure, internal API paths, feature flags, comments and client-side logic all become readable, and any secret or endpoint that should never have shipped becomes visible. The report does not demonstrate any follow-on exploitation, and the P4 priority reflects that the finding is an information leak rather than a direct compromise.

How this kind of bug works

Modern front-end code is bundled and minified before deployment. Source maps exist so that a developer's browser can show the original code in DevTools when something breaks. If the build emits maps into the public output directory and the web server serves them, the map is as public as the bundle.

Browsers only fetch a map when DevTools is open, so the leak is invisible in normal traffic and in most monitoring. The map is usually referenced by a trailing comment in the JavaScript file, and the file itself often sits next to the bundle with a .map suffix. Defences are deployment-side: do not publish maps to production, or publish them to an access-controlled location and upload them to the error-monitoring service instead. Where maps must be public, strip sourcesContent so only position mappings remain. A WAF rule or server configuration that refuses .map requests is a stopgap, not a fix, because the file can still be fetched by any path that bypasses the rule.

How to test for it

  1. Load the target in a browser and open DevTools with the Network panel recording. Reload the page and filter for JavaScript responses.
  2. Inspect the tail of each bundle for a source map reference comment. If one is present, request the referenced path directly and check the response.
  3. Where no comment exists, try the conventional sibling path: take the bundle URL and append .map.
  4. A positive result is an HTTP 200 with a JSON body containing version, sources and mappings, and ideally a populated sourcesContent. Confirm that the recovered files are real application source and not library code.
  5. Check lazily loaded chunks as well as the entry bundle, since route-level chunks are often built with the same settings.

Common false positives: a map that returns 200 but contains only third-party vendor code, which is public anyway; a map whose sourcesContent is empty, leaving only file names; and a soft 404 page served with a 200 status that happens to contain the word sources. Verify the JSON structure before reporting. Also check whether the map is reachable without authentication when the application itself requires a login, since that changes the severity.

How it is fixed

The standard fix is to stop emitting or publishing source maps in production builds, or to emit them to a private bucket that only the error-tracking pipeline can read. If maps must be served, remove sourcesContent so original code is not embedded, and restrict access to the map files. Build configuration should make the production setting explicit so a debug build cannot be deployed by accident, and a deployment check should fail if .map files appear in the public artefact.

Hunting notes

Source map exposure hides in single-page applications, admin consoles and anything built with a modern bundler. Recon signals include large minified bundles, framework-specific runtime files, and build directories such as static/js/ or assets/ in the HTML. Automated discovery works by crawling script tags, extracting bundle URLs, and probing for the map reference and the .map sibling. Prioritise bundles that look application-specific over vendor chunks.

To make the report land, show the recovered source is genuinely the target's own code: quote a distinctive original file path or a fragment of application logic from sourcesContent, and state whether the map was reachable unauthenticated. Keep the dump out of the report body and describe its scope instead. Programs tend to accept these reports when the leaked code is first-party and the map is publicly reachable; they tend to close them when the map only exposes open-source libraries.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

Bitbucket Cloud is Atlassian's hosted service for storing and managing code repositories, and Bitbucket Pipelines is its built-in system for running automated build and test jobs. Both live at https://bitbucket.org. The researcher, talkingllama, found that the website was handing out something it should have kept private: source maps.

To understand why that matters, you need to know what a source map is. Websites today are not written in the form the browser actually runs. Developers write code in readable files, and a build step squashes those files together and shortens every name until the result is small and fast but almost unreadable to a human. A source map is a companion file that records how the squashed code corresponds to the original files. It exists so that when a developer opens the browser's built-in inspection tools and something breaks, the browser can show the original, readable code instead of the squashed version.

That is useful during development. On a live public site it is a problem, because anyone can download the map and use it to recover the original code. Atlassian's own summary of the finding is one line: source code leakage due to an exposed sourcemap in Bitbucket Cloud.

The researcher's description is just as short. Source maps were being served from the site, and because of that the entire source code behind the bitbucket.org front end, which the report calls the Bitbucket Cloud codebase, could be dumped. The stated method is to use Chrome DevTools, the inspection panel built into Google's Chrome browser, to list all the files and then dump them. The report does not name a specific URL, parameter or request; the only location given is the site root:

Text
https://bitbucket.org

The researcher says a full source code dump was attached to the report. The attachment is not reproduced here, so the contents of the dump are not described.

The report metadata records the submission on 21 May 2020 at 12:21:30 UTC, the target category as Web App, and the VRT classification as Automotive Security Misconfiguration > Infotainment > Source Code Dump. VRT is the Vulnerability Rating Taxonomy, a shared list of bug types used to label reports consistently. The priority was P4, the lowest of the priority levels, and the bounty was 200.00 USD. The report was disclosed publicly on 22 January 2021. It does not describe a fix.

Root cause

The likely mistake is that production builds were shipped with source maps, and those map files were reachable from the public site. When the map is served publicly, anyone who can load the bundle can also load the map and recover the pre-build source.

Impact

The report's claim is confidentiality loss: the source code of the Bitbucket Cloud front end could be dumped in full. Source disclosure on its own does not give an attacker execution or access, but it shortens reconnaissance considerably. Original file names, directory structure, internal API paths, feature flags, comments and client-side logic all become readable, and any secret or endpoint that should never have shipped becomes visible. The report does not demonstrate any follow-on exploitation, and the P4 priority reflects that the finding is an information leak rather than a direct compromise.

In general, how this kind of bug works

Modern front-end code is bundled and minified before deployment. Source maps exist so that a developer's browser can show the original code in DevTools when something breaks. If the build emits maps into the public output directory and the web server serves them, the map is as public as the bundle.

Browsers only fetch a map when DevTools is open, so the leak is invisible in normal traffic and in most monitoring. The map is usually referenced by a trailing comment in the JavaScript file, and the file itself often sits next to the bundle with a .map suffix. Defences are deployment-side: do not publish maps to production, or publish them to an access-controlled location and upload them to the error-monitoring service instead. Where maps must be public, strip sourcesContent so only position mappings remain. A WAF rule or server configuration that refuses .map requests is a stopgap, not a fix, because the file can still be fetched by any path that bypasses the rule.

In general, how to test for it

  1. Load the target in a browser and open DevTools with the Network panel recording. Reload the page and filter for JavaScript responses.
  2. Inspect the tail of each bundle for a source map reference comment. If one is present, request the referenced path directly and check the response.
  3. Where no comment exists, try the conventional sibling path: take the bundle URL and append .map.
  4. A positive result is an HTTP 200 with a JSON body containing version, sources and mappings, and ideally a populated sourcesContent. Confirm that the recovered files are real application source and not library code.
  5. Check lazily loaded chunks as well as the entry bundle, since route-level chunks are often built with the same settings.

Common false positives: a map that returns 200 but contains only third-party vendor code, which is public anyway; a map whose sourcesContent is empty, leaving only file names; and a soft 404 page served with a 200 status that happens to contain the word sources. Verify the JSON structure before reporting. Also check whether the map is reachable without authentication when the application itself requires a login, since that changes the severity.

In general, how it is fixed

The standard fix is to stop emitting or publishing source maps in production builds, or to emit them to a private bucket that only the error-tracking pipeline can read. If maps must be served, remove sourcesContent so original code is not embedded, and restrict access to the map files. Build configuration should make the production setting explicit so a debug build cannot be deployed by accident, and a deployment check should fail if .map files appear in the public artefact.

In general, hunting notes

Source map exposure hides in single-page applications, admin consoles and anything built with a modern bundler. Recon signals include large minified bundles, framework-specific runtime files, and build directories such as static/js/ or assets/ in the HTML. Automated discovery works by crawling script tags, extracting bundle URLs, and probing for the map reference and the .map sibling. Prioritise bundles that look application-specific over vendor chunks.

To make the report land, show the recovered source is genuinely the target's own code: quote a distinctive original file path or a fragment of application logic from sourcesContent, and state whether the map was reachable unauthenticated. Keep the dump out of the report body and describe its scope instead. Programs tend to accept these reports when the leaked code is first-party and the map is publicly reachable; they tend to close them when the map only exposes open-source libraries.

Glossary

  • Source map: a companion file that maps squashed, minified code back to the original readable source files.
  • Minification: the build step that removes whitespace and shortens names to make code smaller and faster to load.
  • Bundle: the single JavaScript file produced by combining many source files during a build.
  • Chrome DevTools: the inspection panel built into the Chrome browser, used to view files, network traffic and errors.
  • Source code dump: a copy of an application's original source files recovered from a public site.
  • Confidentiality loss: a security failure where information that should stay private becomes readable by outsiders.
  • Reconnaissance: the information-gathering phase of an attack, before any exploitation.
  • sourceMappingURL: the comment at the end of a JavaScript file that points the browser to its source map.
  • JSON: a plain-text data format built from keys and values, used by source maps.
  • HTTP 200: the status code a web server returns when a request succeeds.
  • Soft 404: a page that says "not found" but is still served with a success status code.
  • WAF: a web application firewall, a filter placed in front of a site to block suspicious requests.
  • VRT: the Vulnerability Rating Taxonomy, a shared list of bug types used to label reports.
  • P4: the lowest priority level in a bug bounty programme's rating scheme.
  • First-party code: code written by the organisation itself, as opposed to third-party libraries.
  • Vendor chunk: a bundle made up of third-party library code rather than the site's own code.

More from Atlassian

View all

The newest disclosed reports for this program.

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.