Sql Injection Leads To Dump The Student Pii
A download page accepted a university number and passed it into a SQL query without sanitisation, causing a MySQL error when an apostrophe was used. The author then used an automated tool to dump the database and obtain students' personally identifiable information.
In this writeup I will tell you how I found the SQLi in the educational website.
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
Impact
An attacker could read the entire database, including students' personally identifiable information; the author also tried to get an operating system shell but lacked file write permission.
What the attacker needed
Access to the download page; a valid university number
How it was found
- Find the download page that asks for a university number.
- Enter a valid university number to view the receipt history.
- Click a receipt link that includes a number parameter in the URL.
- Insert an apostrophe into the parameter and observe a MySQL error.
- Use an automated SQL injection tool to dump the database.
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.
The website had a page where you type a student number to download a receipt. The site put that number directly into a database command without cleaning it first. By typing a special character, the author made the database show an error, which proved the input was not safe. Then they used a tool to automatically extract all the data, including private student 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.