Skip to content
SQL injection Write-up Intermediate

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.

Aditya Bhatt Follow

Published on infosecwriteups.com

WriteUp by Aditya Bhatt | Bug Bounty | SQL Injection | WAF Bypass | XML Encoding

Aditya Bhatt, on infosecwriteups.com

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

  1. Open a product and click Check Stock to trigger a POST request.
  2. Capture the request in Burp Proxy and send it to Repeater.
  3. Observe the XML body with productId and storeId parameters.
  4. Test storeId with 1+1 and see the response for Store 2, confirming SQL injection.
  5. Try a UNION SELECT and get blocked by a WAF.
  6. 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.

More by Aditya Bhatt

View all

25 more disclosed reports, best first.

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.