How I Made $5,000 (₹4.49 Lakh) in Just 1 Hour by Scanning JavaS
Old JavaScript bundles archived from 2020 onward contained API keys that were removed from the current version but never revoked. The author used those keys to pull sensitive production data, including personal information, and earned a bounty.
Published on mokhansec.medium.com
Hi everyone, It’s been a while since I published something useful, so here’s a quick write-up of how I made $5,000 in about one hour of focused recon. Yes, this is literally just from analyzing JavaScript files nothing advanced, no fuzzing, no complex exploitation.
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 developers removed exposed API keys from the current JavaScript bundle but failed to revoke or rotate the keys, leaving them valid.
Impact
An attacker could use the still-valid keys to access sensitive production data, including personal information, and the author reports earning $3,500 from that single issue.
What the attacker needed
Access to archived JS files; exposed keys still valid; no authentication needed
How it was found
- Check the page source and note that the app uses bundled JavaScript files such as main.js and app.js.
- Pull the current JavaScript bundles and compare them with older versions from Web Archive snapshots starting in 2020.
- Find that a 2022 snapshot contains exposed API keys, while the 2023 snapshot has them removed.
- Confirm that the keys from the old snapshot are still active and usable today.
- Use simple cURL requests with those keys to retrieve sensitive production data, including personal information.
- Use gau, waybackurls, and subjs to gather every JavaScript file historically associated with the domain, then review them manually for more secrets.
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.
Websites often ship JavaScript files that run in your browser. Sometimes developers accidentally leave secret keys in those files, then delete them later. But if they forget to disable the old keys, anyone who finds an archived copy of the file can still use them to access private data.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.