Skip to content
SQL injection Write-up Intermediate

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.

salaheddine_kalada Follow

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.

Салах, on medium.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 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

  1. Map the attack surface and test endpoints for weak points.
  2. Identify an endpoint that handles user input without proper sanitisation.
  3. Inject simple test payloads and observe unusual errors or delayed responses.
  4. Use time-based payloads and confirm the server response time increases consistently.
  5. 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.

More by salaheddine_kalada

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.