My First Valid Bug Bounty Report: One JS Scan, One Hidden API Key
Two Anthropic Claude Enterprise API keys were hardcoded in JavaScript files served by the application. An attacker who found them could make unlimited API calls billed to the organisation, potentially causing financial loss and data exfiltration.
This blog is going to be a little different from the usual technical writeups you see floating around. I’m going to introduce myself, talk about how I got into bug bounty hunting, and walk you through how I found my very first valid bug that paid me $200.
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, developers embedded live API credentials directly in client-side JavaScript instead of keeping them on the server.
Impact
A valid key could allow unlimited API calls billed to the organisation, causing financial cost and enabling data exfiltration under the organisation's account.
What the attacker needed
Access to the target's web pages; a free account on the target
How it was found
- Collect JavaScript file URLs automatically with a crawler and manually through a proxy while logged in.
- Merge and deduplicate the two lists of JavaScript URLs.
- Scan the JavaScript files for secret patterns using a secret analyser.
- Identify two keys matching the Anthropic API key format and verify one with the provider's validation check.
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.
JavaScript files that run in your browser are public, so anyone can read them. If a developer accidentally leaves a secret key inside one, anyone who looks can use that key to access a paid service. Here, two keys for an AI service were left in the code, and the finder confirmed they worked.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.