How I Identified a SQL Injection Vulnerability in an E-Commerce W
A product page URL parameter was passed to the database without proper validation, allowing SQL injection. An attacker could use it to enumerate the database and potentially reach sensitive customer information.
Published on medium.com
I began by visiting the target e-commerce website: https://example.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 product identifier from the URL was concatenated into a database query without parameterisation or validation.
Impact
An attacker could enumerate the database structure and potentially access sensitive customer data.
What the attacker needed
Access to the public product page; none
The fix
The parameter should be fixed by using parameterised queries and validating the input rather than building queries from raw URL values.
How it was found
- Visit the e-commerce site and identify the backend as PHP with MySQL.
- Open a product page and note the 'd' parameter in the URL.
- Run an automated SQL injection tool against that parameter.
- The tool confirms the parameter is injectable and enumerates databases.
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 website often builds database queries using values from the URL. If it drops those values straight into the query without checking them, a tester can add extra database instructions and read data they should not see. This is called SQL injection.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.