SQL injection on the https://████/
A blind SQL injection vulnerability was found in the doc_id parameter of a library.php endpoint, allowing an attacker to delay database responses by injecting time-based queries. The attacker could retrieve database information, such as the number of databases, but no other data was accessed.
- Triaged in 23 hours
- Fixed in 3 months
- Disclosed after 8 months
##Description Hello. I was able to find Blind SQL injection on the https://███/ Database appears to be MySQL 5.
##POC
GET /library.php?path=test&doc_id=1%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(1)))WUeh) 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: _ga=GA1.2.1697249984.1548431559
By issuing sleep(0) response will be delayed to 0 seconds. By issuing sleep(1) response will be delayed to 5 seconds. By issuing sleep(2) response will be delayed to 10 seconds. By issuing sleep(5) response will be delayed to 25 seconds.
As POC, I retrieved count of databases (3). No other information was accessed (such as tables or data):
Apparently, SQL statement is executing 5 times on the database side, because response time always 5 times bigger than supplied sleep value.
Impact
SQL injection usually have high-critical impact.
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 doc_id parameter is concatenated directly into an SQL query without parameterisation or input validation.
Impact
An attacker could use the blind SQL injection to extract database information, though in this report only the count of databases was retrieved and no other data was accessed.
What the attacker needed
None
How it was found
- Send a request to the library.php endpoint with a doc_id parameter containing a time-delay SQL payload.
- Observe that the response is delayed by a multiple of the supplied sleep value, 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.
A blind SQL injection is a flaw where user input is inserted into a database command without proper handling, letting an attacker ask yes/no questions to the database. Here, the attacker used a delay command to confirm the injection worked, which could let them extract data slowly.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.