From an error message to DB disclosure
A PHP file on a subdomain displayed an error message that included a URL to mongolab.com containing an API key. The attacker used that key to access the mLab API and list databases, then accessed sensitive data.
Welcome on my first write-up. Today, I would like to share a simple but interesting bug I found some months ago on a public program.
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 application exposed a database service API key in a verbose error message.
Impact
The attacker could list databases and access sensitive data through the mLab API.
What the attacker needed
Access to the subdomain; error message reveals API key
The fix
The issue was resolved according to the timeline.
How it was found
- Found a PHP file on a subdomain that showed an error message.
- Noticed the error contained a URL to mongolab.com with an API key.
- Used the API key with the documented mLab API request to list databases.
- Explored the API resources to access sensitive data.
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 error message on a website accidentally showed a secret key for a database service. The finder used that key to log into the service and read the databases, which should have been private.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.