Two XSS vulns in widget parameters (all_collections.php and o2.php)
Two widget endpoints reflected user input from the city_id and language_id parameters without filtering HTML or JavaScript. An attacker could embed the crafted URLs in an iframe on their own site so that visiting Zomato users would run arbitrary script in the zomato.com origin.
Originally disclosed on HackerOne
- Triaged in 27 days
- Fixed in 4 months
- Disclosed after 6 months
I have found two additional possibilities of XSS attacks via the widget API endpoints: https://www.zomato.com/widgets/all_collections.php and https://www.zomato.com/widgets/o2.php
https://www.zomato.com/widgets/all_collections.php has a vulnerable city_id parameter that does not filter html or javascript:
The https://www.zomato.com/widgets/o2.php endpoint has a vulnerable language_id parameter, which does not filter html or js:
https://www.zomato.com/widgets/o2.php?theme=redar&sort=popularityo&csrf_token=bcac41f373322e378a299618228ad23b&language_id=%22}%27%29;alert%28document.domain%29;console.log%28%27
These URLs can be placed in <iframe> elements in an attacker-controlled website and any Zomato users visiting that site are open to executing arbitrary javascript in the zomato.com origin, which opens them to CSRF attacks and others.
I have tested the other parameters and have found them to be sanitized.
These two parameters should be sanitized.
Cheers!
Attachments

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 widget scripts echo the city_id and language_id request parameters into the HTML response without encoding or validating them.
Impact
A Zomato user who visits an attacker page hosting the iframe could have arbitrary JavaScript run in the zomato.com origin, which the reporter says could lead to CSRF and other attacks.
What the attacker needed
Victim visits attacker-controlled page; attacker embeds widget URL in an iframe
The fix
The two parameters should be sanitised so the reflected values cannot inject HTML or script.
How it was found
- Open the all_collections.php widget URL with a crafted city_id value.
- The crafted city_id value is reflected without filtering.
- Open the o2.php widget URL with a crafted language_id value.
- The crafted language_id value is reflected without filtering.
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.
A reflected cross-site scripting (XSS) bug means a website takes something from the address bar and puts it straight into the page without cleaning it. If that something is code, the visitor's browser runs it as if the site itself wrote it. Here two widget pages did this, so a malicious page could load them in a frame and run code in the Zomato context.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.