Bypassing Like a Pro: How I Fooled the WAF and Made It Pay
The search API endpoint was vulnerable to SQL injection, and the web application firewall (WAF) could be bypassed using encoded characters and inline comments. An attacker could extract database version, user, and sensitive user data including usernames, password hashes, and emails.
medium.com
Published on medium.com
Free Linkπ
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 did not properly sanitise user input and used dynamic SQL queries, allowing SQL injection despite the WAF.
Impact
An attacker could extract sensitive user data including usernames, password hashes, and emails, leading to full PII exposure.
What the attacker needed
Access to the API endpoint; no authentication mentioned
The fix
The application should use parameterized queries and sanitise inputs at the backend, rather than relying solely on a WAF.
How it was found
- Send a simple SQL injection payload to the search endpoint and observe a 403 WAF block.
- Try encoded characters and mixed-case keywords to bypass the WAF.
- Use inline comments and encoded characters to craft a working UNION-based SQL injection.
- Extract database version and user via the search endpoint.
- Extract usernames, password hashes, and emails via the user endpoint.
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 WAF is a security tool that tries to block attacks like SQL injection, where malicious code is inserted into database queries. Here, the attacker found ways to write the attack so the WAF did not recognise it, and then read private information from the database.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.