From Exposed API Keys to Account Takeovers
API keys were exposed in archived URLs and some remained valid, allowing an attacker to access and modify account resources. The author demonstrated read and write access using a working key.
medium.com
Published on medium.com
Hey Hackers, I am Parth Narula. A penetration tester, bug hunter, red teamer and overall a security researcher.
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, API keys were included in URLs that were archived and never revoked, and the API accepted keys as URL parameters.
Impact
The exposed API key allowed read and write access to account resources, potentially leading to account takeover.
What the attacker needed
API keys exposed in archived URLs; At least one key remains valid
The fix
API keys should be revoked and not exposed in URLs; secrets should be rotated regularly.
How it was found
- Search the Web Archive for archived URLs containing sensitive parameters like tokens or API keys.
- Identify archived URLs with API keys in the api_key parameter.
- Test each exposed key to see if it is still valid by making API requests.
- Use a valid key to authorize in the Swagger interface.
- Access endpoints such as viewing logs to confirm read access.
- Create a new log entry to confirm write access.
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.
An API key is like a password that lets software talk to a service. Here, old web pages saved in an archive contained these keys, and some still worked, so someone could use them to read and change data in the account.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.