How I found Critical Bug From Regular Pagination
A pagination parameter was passed to PHP without validation, so a non-numeric value caused a fatal type error and a 500 response. Because the server ran in development mode, the error page disclosed the full file path, configuration and database credentials to anyone who sent the request.
Published on medium.com
Major vulnerabilities aren’t always apparent; sometimes, what we consider trivial turns out to be the beginning of something truly extraordinary. In this article, I’ll share my experience with this discovery, and it’s sure to be a thrilling one.
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 page parameter was used directly in arithmetic without casting or validation, and the framework's debug mode was left enabled in production, so the resulting exception page exposed configuration and credentials.
Impact
Anyone could trigger the error and read internal file paths, configuration and database credentials, which could lead to further compromise of the system.
What the attacker needed
None
The fix
The bug was fixed by the relevant team; the underlying fix is to validate and cast the page parameter and to disable development/debug mode in production.
How it was found
- Open the paginated listing page with its normal page parameter.
- Replace the page value with a non-numeric input such as a path traversal string.
- Observe the server return a 500 error instead of a page.
- Read the debug page shown in the response, which lists paths, configuration and database credentials.
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 website page number in the address bar was expected to be a number, but the site never checked. Sending something that is not a number made the program crash. The site was set up to show detailed crash information, so it revealed internal file locations and database login details to the visitor.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.