API key: The real goldmine
A third-party API secret key was exposed in a hidden HTML input field. An attacker could use the key to make calls beyond the free quota, causing the company to incur additional charges.
Today I would like to share an interesting way to exploit an API leakage. On a side note, this bug was found on a private program, so all the informations about the company/detailled exploitation will be redacted.
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 secret key was embedded in client-side HTML instead of being kept on the server.
Impact
The company could incur additional charges for API calls made beyond the free quota.
What the attacker needed
Access to the web page
How it was found
- View the HTML source code of the page.
- Find a hidden input field containing a URL with a random string.
- Recognise the random string as a secret key for a third-party API.
- Use the key to make API calls beyond the free quota.
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 a program use a paid service. Here, the key was left in the web page's code, so anyone could find it and use the service on the company's account, running up a bill.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.