Behind the Shop: How a Simple SQLi in the Products Page Gave Me F
A SQL injection vulnerability was found in the 'view' parameter of a store page, allowing an attacker to extract data from the database. The attacker could retrieve usernames, passwords, emails, and other sensitive information from nearly 10,000 user accounts.
Published on waleedosamaeg.medium.com
Today, I’m here to share a new vulnerability I found in a game website — yes, I just can’t stop poking around where I shouldn’t �
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
The application inserted user input directly into an SQL query without proper sanitisation or parameterisation.
Impact
The attacker could extract sensitive user data including usernames, passwords, emails, and mobile numbers from nearly 10,000 accounts.
What the attacker needed
A test account; victim not required
How it was found
- Log in with a test account and navigate to the store page.
- Click on a product to open its details page, noting the 'view' parameter in the URL.
- Change the 'view' parameter value to a single quote to test for SQL injection, observing an error.
- Use a payload list with Burp Intruder to find a working payload that comments out the rest of the query correctly.
- Use ORDER BY to determine the number of columns (4) and then a UNION attack to extract the database name.
- Extract table names, find the 'accounts' table, and use UNION with GROUP_CONCAT to dump usernames and passwords.
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 a type of attack where a hacker inserts malicious code into a website's database query, tricking it into revealing or changing data. Here, the store page took a number from the URL and put it directly into a database command without checking it, so the attacker could add extra commands to see other information. This let them steal private details of many users.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.