Find SQL injection with burp Suite scanner
A SQL injection vulnerability was found in the idEntity parameter, but a web application firewall (WAF) blocked exploitation attempts. The attacker bypassed the WAF by injecting through a cookie parameter, allowing full database extraction.
Burp’s scanner has detected a potential SQL injection on one of my bug bounty program target endpoints. According to it, the idEntity parameter of this endpoint is vulnerable.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the application fails to properly sanitise user input in both the idEntity parameter and the idEntitySelected cookie before using it in SQL queries.
Impact
An attacker could extract arbitrary data from the database, as demonstrated by the successful UNION-based injection through the cookie.
What the attacker needed
Access to the endpoint; ability to send crafted requests
How it was found
- Send a request with a boolean-based SQL injection payload in the idEntity parameter and observe different responses.
- Run sqlmap with options to target boolean-blind injection and specify a string that indicates failure.
- Notice that sqlmap receives empty responses, indicating a WAF is blocking.
- Discover the idEntitySelected cookie using Burp ParamMiner.
- Manually test the cookie with a time-based injection and see a delay, confirming the WAF does not block it.
- Run sqlmap targeting the cookie parameter with appropriate options to exploit 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 write-up has not been written yet. The Original tab links to the source.
A SQL injection lets an attacker insert database commands into a web request. Here, a firewall blocked the usual attack method, but the attacker found another way to send the same commands through a cookie, which the firewall did not check as strictly.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.