Skip to content
SQL injection Disclosed report Beginner

SQL Injection in www.██████████

The POST rnum parameter was vulnerable to SQL injection, allowing an attacker to alter the database query. This could let an attacker dump sensitive data such as usernames and password hashes, or perform authentication bypasses.

Valerio brussani Follow

Originally disclosed on HackerOne

  • Triaged in 48 hours
  • Fixed in 26 days
  • Disclosed after 3 months

##Description: SQL Injection is a vulnerability which allows interference with the queries performed on a database, to obtain sensitive information which could be really useful to attackers. A web application database is often queried using user-requests parameters, which when are not properly sanitized can be modified injecting malicious code. In this case, the vulnerable endpoint is http://www.████████ and the vulnerable parameter is the POST rnum parameter. Respecting the program guidelines, I performed the minimal amount of testing required to prove that a vulnerability existed, but please tell me if I can bring the exploitation further to give more information.

##Reproduction steps 1 -Repeat the below requests with a interceptor proxy (for example, using Burp).

POST ████ HTTP/1.1
Host: www.████
Content-Length: 72
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://www.███████
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://www.███████████
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,it-IT;q=0.8,it;q=0.7
Cookie: PHPSESSID=█████
Connection: close

███████
POST ██████████ HTTP/1.1
Host: www.███████
Content-Length: 72
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://www.█████
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://www.████████████████
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,it-IT;q=0.8,it;q=0.7
Cookie: PHPSESSID=████
Connection: close

█████

In the first case, the record obtained from the database is the following:

██████

██████ Whilst in the second case, the record obtained is:

███

█████ This confirms that the OFFSET clause is concatenated to the original query and there is the possibility to exploit a SQL Injection.

Impact

The vulnerability could allow an attacker to dump sensitive and personal data from the web application database (such as usernames and password hashes) or to perform authentication bypasses.

The original report as published on HackerOne, by val_brux. 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 concatenated the user-supplied rnum parameter directly into an SQL query without sanitisation or parameterisation.

Impact

The vulnerability could allow an attacker to dump sensitive and personal data from the web application database (such as usernames and password hashes) or to perform authentication bypasses.

What the attacker needed

Access to the vulnerable endpoint; ability to send POST requests

How it was found

  1. Send a POST request to the endpoint with a normal rnum value using an intercepting proxy.
  2. Observe the database record returned for the normal value.
  3. Send a second POST request with a modified rnum value that includes SQL syntax.
  4. Observe that a different database record is returned, confirming the injection.

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 user input is inserted into a database query without proper cleaning, so an attacker can change the query's meaning. Here, the rnum value in a form submission was placed directly into the SQL, letting the attacker add extra SQL commands. The reporter showed that changing the input changed which database record came back, proving the injection.

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 Valerio brussani

View all

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