SQL Injection Leads to $$ Bounty: How I Found a Critical Bug
An API endpoint was vulnerable to unauthenticated SQL injection because a query parameter was not properly sanitised. An attacker could use this to steal user data, modify records, or potentially gain full database access.
Published on medium.com
Bug hunting is a bit like treasure hunting — except instead of digging in dirt, you’re digging through code. And sometimes, all it takes is a little curiosity and a rogue quote to strike gold.
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 concatenated user input directly into an SQL query instead of using parameterised queries, and it also exposed database error messages to users.
Impact
An unauthenticated attacker could steal user data, modify records, and potentially gain full database control, though the text does not show actual data extraction.
What the attacker needed
None
The fix
The issue was fixed by the security team after the report; the recommended fix is to use parameterised queries, validate input, and avoid exposing database errors.
How it was found
- Find the API endpoint with the is_display parameter.
- Add a single quote to the parameter value and observe a database error.
- Save the request and run SQLMap against it.
- SQLMap confirms the endpoint is vulnerable to unauthenticated SQL injection.
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 program puts user input directly into a database command, so a clever input can change what the command does. Here, adding a single quote to a number in the URL caused a database error, showing the input was not handled safely. Anyone could exploit this without logging in, potentially reading or changing data in the database.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.