Full Path Disclosure by removing CSRF token
Removing the CSRF token from a POST request causes a PHP error that reveals the full server file path. An attacker could use this path information to learn about the server's directory structure.
- Disclosed after under an hour
Hello, you can get an error and full path disclosure by following these steps: on any user generated POST request (such as during login, or changing user data) remove the CSRF token from the post request entirely. For example, on the login POST request,
_CSRF_TOKEN=WqXB7vmysdM06gBarWZiNfnZ%3AOMznb0rVagzWr41P_h_N2Qj50LwPV2HZxKyJxR17lB6b&username=zrgzrgzerg&passphrase=sergsergsergrg&two_factor=
Becomes
username=zrgzrgzerg&passphrase=sergsergsergrg&two_factor=
We get the following error with a full path disclosure:
<br /> <b>Notice</b>: Undefined variable: ex in <b>/var/www/csprng/src/public/index.php</b> on line <b>160</b><br /> <br /> <b>Fatal error</b>: Uncaught Error: Call to a member function getMessage() on null in /var/www/csprng/src/public/index.php:160 Stack trace: 0 {main} thrown in <b>/var/www/csprng/src/public/index.php</b> on line <b>160</b><br />Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application does not handle a missing CSRF token gracefully, leading to an uncaught error that exposes the file path.
What the attacker needed
Ability to send POST requests
How it was found
- Intercept a POST request that includes a CSRF token, such as the login request.
- Remove the CSRF token parameter from the request body.
- Send the modified request.
- Observe the error response containing the full path disclosure.
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 report has not been written yet. The Original tab links to the source.
When a web form is submitted, it includes a hidden security token to prevent cross-site request forgery. If you remove that token, the server tries to use it but fails, and shows an error message that includes the full file path on the server. This path can help attackers understand how the server is set up.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.