How a Routine XSS Hunt Led to an Unexpected Database Information Disclosure
PHP source code and database connection details were exposed in the client-side page source of a web application. The author also found an accessible phpMyAdmin endpoint, but states the disclosure alone gave no direct access to data or records.
Published on medium.com
There was nothing unusual about the assessment. I was inspecting the application as I normally would, checking pages and reviewing the source code for potential XSS vectors.
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 server-side code and configuration were rendered into or served alongside client-side output instead of being kept on the server.
Impact
The exposed details did not by themselves allow authentication, data viewing or record changes, but they could be useful in a larger attack chain, and an accessible phpMyAdmin endpoint was also found.
What the attacker needed
None
The fix
The issue was responsibly reported and subsequently remediated, though the text does not describe the fix itself.
How it was found
- Browse the application and review the page source.
- Notice PHP code and database connection details in the client-side source.
- Carry out further reconnaissance on the exposed resources.
- Find an accessible phpMyAdmin endpoint.
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.
Web pages are built from files the browser downloads, and normally only the parts meant to be seen are sent. Here, pieces of the server-side code and database connection details leaked into what the browser received, so anyone viewing the page source could read them. On their own they did not let anyone log in or change data, but they could help an attacker plan further steps.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.