Append .map to JavaScript bundle URLs to recover the original source

Information disclosureRecon

Production bundles are minified, but many sites still ship their source maps. For every script the target loads, request the same URL with .map on the end (app.4f2c1.js becomes app.4f2c1.js.map), and look at the last line of the bundle for a //# sourceMappingURL= comment that names the file.

A source map holds the original source files, often with developer comments, internal API routes, feature flags and keys that minification hid. Unpack it with a tool such as sourcemapper, or read its sourcesContent array, then search the result for api/, admin, debug and key.

Stay within the program's scope, and before reporting a key, check that it is live and what it can reach.

Follow #javascript, #recon or #source-maps for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.

Comments

No comments yet.