How I Found a SQL Injection in a VDP Program
A PHP file on a subdomain was vulnerable to SQL injection through the idcity parameter, as confirmed by a time-based test. An attacker could manipulate database queries, potentially extracting or altering data.
Published on medium.com
Recently, I was working on a Vulnerability Disclosure Program and came across a subdomain: what.redacted.com .
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 idcity parameter was concatenated into a SQL query without parameterisation or sanitisation.
What the attacker needed
Access to the subdomain; knowledge of the idcity parameter
How it was found
- Crawl the application and find PHP files, including index_ideal.php.
- Use the GAP extension to collect parameters and fuzz index_ideal.php with x8, identifying the idcity parameter.
- Fuzz for additional PHP files with ffuf, finding index_mod.php which returned a MySQL error.
- Reuse the idcity parameter on index_mod.php and observe a changed MySQL error.
- Test the parameter with a time-based payload and see a 5-second delay, confirming SQL injection.
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.
SQL injection is when a website puts user input directly into a database command, letting an attacker change the command. Here, the idcity parameter was used in a database query without proper handling, so a crafted input could make the database wait, proving the flaw.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.