Skip to content
Info disclosure Write-up Beginner

Bypassing the Frontend Obfuscation: How I Uncovered a Company’s Entire Internal Architecture…

The web application left JavaScript source map files publicly accessible in production, allowing anyone to download the original unminified source code. An attacker could use this to discover hidden API endpoints, backend technology stack, and environment variable names, though no actual secrets were exposed.

priyanshbhadoria5 Follow

Published on medium.com

As bug bounty hunters, we are trained to find the chink in the armor. But what happens when the target has no visible cracks?

Priyansh, on medium.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 Next.js configuration did not disable production browser source maps, so the build process generated .map files that were served publicly.

Impact

The exposed source maps could allow an attacker to map internal architecture, identify backend technologies, and craft more targeted attacks, though the report notes that no hardcoded secrets were found and the Mapbox token was properly restricted.

What the attacker needed

None

The fix

The source maps should be disabled in production by setting productionBrowserSourceMaps to false in the Next.js configuration.

How it was found

  1. Enumerate subdomains and probe for live HTTP services.
  2. Extract JavaScript file URLs from the HTML source, noting Next.js chunk paths.
  3. Append .map to a JavaScript chunk URL and request it.
  4. Download the returned source map file.
  5. Use jq to extract the sourcesContent array containing the original code.
  6. Analyse the unminified code to find API routes, imports, and environment variable names.

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 build a website, they often compress the code to make it load faster. They can also create a 'map' file that helps them debug by showing the original, readable code. If that map file is left on the public server, anyone can download it and see exactly how the website works, including hidden parts.

What is Info disclosure?

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

More by priyanshbhadoria5

View all

2 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.