Skip to content
SQL injection Disclosed report Intermediate

[www.zomato.com] Boolean SQLi - /█████.php

The entity_id parameter on a Zomato endpoint was vulnerable to Boolean-based SQL injection. An attacker could manipulate the parameter to infer database information by observing different HTTP status codes.

gerben_javado Follow

Originally disclosed on HackerOne

Bounty$1,000 View original
  • Fixed in 50 days
  • Paid in 50 days
  • Disclosed after 3 months

Summary by the program

@gerben_javado found that the parameter entity_id was vulnerable to SQLi on endpoint /████.php using a Boolean technique.

##POC

The POC uses if(mid(@@version,1,1)=5 which returns a 200 ok message. If changed for if(mid(@@version,1,1)=4 the server gives a 500 or 504 error, confirming the SQLi and proving data extraction.

curl -H 'Host: www.zomato.com' -H 'Cookie: PHPSESSID=XXXXX' 'https://www.zomato.com/████.php?entity_type=restaurant&entity_id=1+or+if(mid(@@version,1,1)=5,1,2)=2%23' -k

Thanks @gerben_javado for helping us in keeping @zomato secure :)

The original report as published on HackerOne, by gerben_javado. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Root cause

Likely the application concatenated the entity_id parameter directly into a SQL query without parameterisation or proper escaping.

Impact

An attacker could extract arbitrary data from the database by asking true/false questions and observing the server's response.

What the attacker needed

Access to the endpoint; a valid session cookie (PHPSESSID)

How it was found

  1. Send a request to the endpoint with a crafted entity_id value that evaluates a true condition.
  2. Observe that the server returns a 200 OK response.
  3. Change the condition to a false one and observe a 500 or 504 error, confirming 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 report has not been written yet. The Original tab links to the source.

SQL injection is when user input is inserted into a database query without proper handling, letting an attacker change the query's logic. Here, the attacker could ask true/false questions to the database and tell the answer from whether the page loaded normally or showed an error. This could let them extract data piece by piece.

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 gerben_javado

View all

9 more disclosed reports, best first.

More from Eternal

View all

The newest disclosed reports for this program.

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.