Skip to content
SQL injection Write-up Intermediate

How I Discovered a Blind SQL Injection in a Private program

A blind SQL injection was found in the asset_id parameter of a PHP endpoint on an origin IP address discovered via DNS records. An attacker could use time-based techniques to extract database information, and the report states that 22 databases were dumped.

mrx_w_ Follow

Published on medium.com

Hi, I’m mrxw (Adem Ziane Berroudja), a bug bounty hunter on Bugcrowd.

mrx_w_, 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 asset_id parameter was concatenated directly into an SQL query without parameterisation or validation.

Impact

An attacker could extract arbitrary data from the database, and the report states that 22 databases were successfully dumped.

What the attacker needed

Access to the origin IP; no authentication on the endpoint

How it was found

  1. Enumerate subdomains of the wildcard scope and find a live subdomain protected by SSO.
  2. Look up DNS records for the subdomain to find its origin IP address.
  3. Access the origin IP directly and explore the application to find the saveChanges.php endpoint.
  4. Submit a value in the filename field and observe the POST request with asset_id, html_content, and json_attributes parameters.
  5. Inject a time-based payload into asset_id and observe a delay to confirm SQL injection.
  6. Use sqlmap with the saved request to dump 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.

SQL injection is when user input is inserted into a database query without proper handling, letting an attacker change the query's meaning. Here, the asset_id value was used in a database command, and by sending a value that makes the database wait, the attacker could confirm the flaw and then extract data.

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 mrx_w_

View all

3 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.