Bypassing Filters Via Xml Encoding To Perform Sql Injection For Bug Hunting With With Burpsuite
The stock check feature was vulnerable to SQL injection because user input in XML was not properly sanitised. An attacker could bypass a WAF filter by encoding the payload as XML entities and use UNION queries to extract usernames and passwords from the users table.
Published on infosecwriteups.com
WriteUp by Aditya Bhatt | Bug Bounty | SQL Injection | WAF Bypass | XML Encoding
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
Impact
An attacker could extract sensitive data such as usernames and passwords from the database, leading to account takeover.
What the attacker needed
Access to the stock check feature; ability to intercept and modify requests; Burp Suite with Hackvertor extension
How it was found
- Open a product and click Check Stock to trigger a POST request.
- Capture the request in Burp Proxy and send it to Repeater.
- Observe the XML body with productId and storeId parameters.
- Test storeId with 1+1 and see the response for Store 2, confirming SQL injection.
- Try a UNION SELECT and get blocked by a WAF.
- Encode the payload using Hackvertor's hex_entities and send it to bypass the WAF.
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.
SQL injection is when a program puts user input directly into a database command, letting an attacker change the command. Here, the input was sent inside XML, and a security filter (WAF) tried to block attacks. By encoding the attack as special XML characters, the filter was fooled and the database still understood the command.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.