[www.zomato.com] Boolean SQLi - /███████.php
A parameter that accepted a JSON array was passed into a SQL query without proper handling, allowing boolean-based SQL injection. An attacker could use true/false responses to infer database information such as the MySQL version.
Originally disclosed on HackerOne
- Fixed in 55 days
- Paid in 55 days
- Disclosed after 3 months
Summary by the program
@gerben_javado found that the parameter brids (which was a JSON array) was vulnerable to boolean SQL injection.
##POC
Requesting MID(0x352e362e33332d6c6f67,1,1)//LIKE//5 (hex == @@version) resulted in a 500 HTTP status and MID(0x352e362e33332d6c6f67,1,1)//LIKE//4 resulted in a 200 HTTP status. Showing that the version of MySQL starts with a 5.
POST /████.php?res_id={RES_ID} HTTP/1.1
Host: www.zomato.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101 Firefox/58.0
Accept: */*
Accept-Language: nl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: PHPSESSID={SESSION_COOKIE};
Content-Type: application/x-www-form-urlencoded
Content-Length: 102
action=show_support_breakups&brids=["')/**/OR/**/MID(0x352e362e33332d6c6f67,1,1)/**/LIKE/**/5/**/%23"]
Thanks @gerben_javado for helping us in keeping @zomato secure :)
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
An attacker could extract information from the database one bit at a time by observing whether requests returned an error or succeeded.
What the attacker needed
Access to the endpoint; a valid res_id value
How it was found
- Send a POST request to the affected PHP endpoint with a res_id query parameter.
- Include the action and brids form fields, where brids is a JSON array containing an injected SQL expression.
- Compare the HTTP status when the injected condition is true versus false to infer data.
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.
When a website builds a database query by pasting in user input, an attacker can sneak in extra database instructions. Here the input was a list of values, and the site did not treat it safely, so the attacker could ask the database yes/no questions and watch whether the page errored or loaded to learn secrets.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.