From an error message to DB disclosure
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.
During my recon process, I discovered on a subdomain, a PHP file with an error message like this :
We can see two main things on this screenshot, an URL pointing to mongolab.com and in this URL an Api Key.
My first reflex was to check what is mongolab, according to their website :
mLab is the leading Database-as-a-Service for MongoDB, powering over half a million deployments worldwide.
Oh a database service, interesting. Let’s go to check what is the « API key » functionality.
According to the documentation :
It’s nice but we need to check if the API key is valid or not. I used the request provided by the documentation :
Nice, I can print the databases. But to be a valid issue, I need to verify if I can gain access to sensitive data. I played with the resources provided by the documentation and finally :
To conclude, read carrefully error messages, they can contain interresting data and can lead to more serious issue.
2018/02/15: Need more infos
2018/02/15: Additional informations provided
I hope you enjoyed this reading !
Thanks to: Cinabre, Yothard