SQL Injection: How I Secured Personal Information (PII) of 1.1M J
An SQL injection flaw in the id parameter of a recruitment website's report page allowed an attacker to run arbitrary database queries. The researcher used it to read database names, the server hostname, user accounts, and personal data of about 1.1 million job seekers.
Published on infosecwriteups.com
Hello, my name is Biraj Baishya, aka brutexploiter. I am an independent security researcher, a full-time bug bounty hunter, and a mechanical engineer.
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 application built its database query by concatenating the untrusted id parameter directly into SQL, without parameterised queries or input validation.
Impact
Successful exploitation could give unauthorised access to sensitive data, including PII of about 1.1 million job seekers, and allow modification of database contents depending on the database user's permissions.
What the attacker needed
None
How it was found
- Open the report page URL with an id parameter in a browser.
- Add a single quote character to the id value.
- Observe that the server returns an SQL error.
- Use ORDER BY to count the columns returned by the query.
- Use a UNION SELECT to query the database version.
- Automate extraction of databases, hostname and users with sqlmap.
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 straight into a database command without cleaning it, so special characters can change the command. Here, adding a single quote to a web address caused a database error, showing the input was not handled safely. The researcher then used that gap to read data the site never meant to show.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.