[www.zomato.com] SQLi on `order_id` parameter
The order_id parameter on an endpoint was vulnerable to SQL injection, allowing an attacker to alter query logic and retrieve data using a boolean-based technique.
Originally disclosed on HackerOne
- Fixed in 5 hours
- Paid in 5 hours
- Disclosed after 20 hours
Summary by the program
@saltedfish found that a parameter order_id was vulnerable to SQLi.
###POC (for everyone to learn from this disclosed report)
- There was an endpoint which had
order_idas one of the parameters. - Requesting
'-if(1=2,'0','1')-'inorder_idparameter changed the Response Length and upon further investigation from @saltedfish, he found that the boolean technique could be used to proof data retrieval.
We'd like to thank @saltedfish for helping us in keeping @zomato secure :)
[REQUEST] Also, a small request to everyone reading this report, Burp Suite Free Version offers lot of features to start with and HackerOne has partnered with Burp Suite to offer 3 months free of Burp Suite Pro to Hackers on achieving 500 Reputation Points. Use that opportunity instead of using Pirated Version.
Cheers.
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 order_id parameter was concatenated directly into a SQL query without parameterisation or validation.
Impact
An attacker could use boolean-based SQL injection to retrieve data from the database.
What the attacker needed
Access to the endpoint; order_id parameter accepted
How it was found
- Find an endpoint that accepts an order_id parameter.
- Send a request with a boolean SQL expression in order_id.
- Observe that the response length changes, confirming injection.
- Use the boolean technique to prove data retrieval.
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 meaning. Here, changing the order_id value changed the response length, which showed the database was reacting to the input and could be tricked into revealing data.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.