Skip to content
XSS Disclosed report Beginner

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.

pr0tagon1st Follow

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:

https://www.zomato.com/widgets/all_collections.php?city_id=%22%3E%3Cimg%20src=http://goo.gl/JPx2sV%3E%3Cscript%3Ealert%28document.domain%29;%3C/script%3E%3Ca%20href=&language_id=alert%281%29&theme=red&csrf_token=bcac41f373322e378a299618228ad23b

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

zomato_poc2.jpg
zomato_poc2.jpg From the original on HackerOne

The original report as published on HackerOne, by pr0tagon1st. 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 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

  1. Open the all_collections.php widget URL with a crafted city_id value.
  2. The crafted city_id value is reflected without filtering.
  3. Open the o2.php widget URL with a crafted language_id value.
  4. 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.

More by pr0tagon1st

View all

2 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.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.