SQL Injection, Reflected XSS and Information Disclosure in one subdomain in just 10 minutes
A subdomain exposed a phpinfo page, a reflected cross-site scripting flaw in a search parameter, and a SQL injection in the same parameter. An attacker could run script in a victim's browser and read database contents through the injection.
Published on web.archive.org
{{media:0}}
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 search parameter was echoed into the HTML and concatenated into a SQL query without validation or parameterisation.
Impact
An attacker could execute script in a victim's browser and use the injection to enumerate database names; the author did not demonstrate data extraction or RCE.
What the attacker needed
Target with many in-scope assets; internet-wide scanning data; archived URLs available
How it was found
- Find a subdomain that returns an empty page and confirm random paths give 404
- Fuzz directories and open the discovered phpinfo page
- Search the web archive for archived endpoints ending in .php
- Open the archived search page and inject HTML to confirm reflection
- Replace the HTML with a script tag to confirm reflected XSS
- Read the page source, spot the SQL query, and confirm injection with a boolean test
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 search box on a website was putting whatever the visitor typed straight into the page and into a database query without cleaning it. That let the author make the page run their own script (cross-site scripting) and make the database reveal its names (SQL injection). A separate page also leaked server setup details.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.