Exposure Protocol: Information Disclosure in the Wild [Part 2]
A debug page exposing phpinfo() output was left accessible, revealing the application's SECRET_KEY. An attacker could use this key to forge sessions or manipulate JWTs, potentially leading to account takeover or remote code execution.
medium.com
Published on medium.com
In Part 1, we started our hunt by tricking a backend into oversharing — grabbing the Apache Struts version from a type mismatch error. You can check out the GitHub PoC here.
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 a debug file (phpinfo.php) was deployed to production without being removed or protected, exposing environment variables including the SECRET_KEY.
Impact
The exposed SECRET_KEY could allow cookie forgery, JWT manipulation, or remote command execution depending on the framework, potentially leading to account takeover or session hijacking.
What the attacker needed
Access to the web application; A debug file left accessible
The fix
Debug and configuration files should never be deployed in production, and access to sensitive paths should be blocked at the web server level.
How it was found
- Access the lab and observe network requests.
- Check HTTP proxy history and find nothing interesting.
- Use Target > Site Map and Find Comments to discover a comment hinting at /cgi-bin/phpinfo.php.
- Send a request to /cgi-bin/phpinfo.php and view the phpinfo() output.
- Locate the SECRET_KEY in the environment variables.
- Copy the key and submit it as the lab solution.
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 debug page is a tool developers use to see details about how a website works, like its configuration. If left online, it can show secrets such as passwords or keys. Here, a secret key was visible, which could let someone pretend to be another user or break into the system.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.