A Secret Key in Plain Sight: How I Earned My First $200 Finding a
An API key for the IPData geolocation service was embedded in a publicly accessible JavaScript file on the target's website. An attacker could use the key to exhaust the service's quota, causing geolocation features to fail for legitimate users, and to incur financial costs on the company's paid plan.
Published on medium.com
This is the story of my first paid bug bounty — a $200 reward from VFS Global, one of the world’s largest visa and consular outsourcing companies. The vulnerability was an API key exposed inside a publicly accessible JavaScript file on their web application onevasco.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 API key was hardcoded into client-side JavaScript instead of being kept on the server or injected at runtime.
Impact
The exposed key could allow an attacker to exhaust the API quota, disrupting geolocation features for legitimate users, and to incur financial costs on the company's paid plan; the key was later removed.
What the attacker needed
None
The fix
The key was removed from the JavaScript bundle and the endpoint now denies access.
How it was found
- Save all in-scope domains to a file.
- Enumerate subdomains using multiple tools.
- Probe live subdomains with httpx.
- Collect URLs from live subdomains using crawlers and archives.
- Filter JavaScript files from the collected URLs.
- Scan JavaScript files with Nuclei secret detection templates.
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.
A secret key is like a password that lets software talk to another service. Here, the key was left inside a file that anyone's browser downloads, so anyone could copy it. With that key, a person could make lots of requests to the geolocation service, possibly using up the company's paid quota and breaking the feature for real users.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.