How I Discovered a Critical SQL Injection in a Private Bug Bounty Program
An endpoint that handled user input did not properly sanitise it, allowing SQL injection. An attacker could use time-based payloads to confirm the injection and potentially compromise sensitive data.
Published on medium.com
Bug bounty hunting is always a journey of persistence, creativity, and learning. Recently, I had the opportunity to uncover a critical SQL injection vulnerability in a private program.
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 endpoint passed user input into a database query without proper sanitisation or parameterisation.
Impact
The vulnerability could allow data exfiltration and privilege escalation, potentially compromising sensitive data.
What the attacker needed
Access to the private program's domains; an endpoint that handles user input
The fix
The endpoint should be fixed by properly sanitising user input or using parameterised queries.
How it was found
- Map the attack surface and test endpoints for weak points.
- Identify an endpoint that handles user input without proper sanitisation.
- Inject simple test payloads and observe unusual errors or delayed responses.
- Use time-based payloads and confirm the server response time increases consistently.
- Use sqlmap to confirm the injection point and reveal database details.
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 directly into a database command without cleaning it first. An attacker can type special database instructions into a form or URL, and the website runs them by mistake. This can let the attacker read or change data they should not see.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.