Skip to content
XSS Disclosed report Intermediate

Reflected XSS on https://www.zomato.com

The state parameter on the Google OAuth callback page was reflected into a script context without proper escaping of a backslash character, allowing an attacker to break out of a string and inject JavaScript. An attacker could execute arbitrary script in an authenticated user's browser to steal information or redirect them to malicious sites.

strukt Follow

Originally disclosed on HackerOne

Medium 5.4 View original
  • Triaged in 31 days
  • Fixed in 33 days
  • Paid in 34 days
  • Disclosed after 2 months

Hello,

I found an XSS issue due to the incorrect handling of the \ character in a <script> context, the following link works as a PoC that alerts the location of the document:

https://www.zomato.com/googleOAuth2Callback?)}(alert)(location);{%3C!--&state=\

The issue exists because, given that the \ character supplied as the state parameter value is not well escaped and reflected into the page, we are able to use it to escape the " and then inject our own JS code to execute it on the page.

Note: This only works when the page is opened by an authenticated user

Impact

This allows an attacker to inject custom Javascript codes that can be used to steal information from Zomato's user base and lure them to malicious websites on the internet on behalf of Zomato's website.

The original report as published on HackerOne, by strukt. 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 reflected the state parameter into a JavaScript string context without correctly escaping backslash characters, allowing a quote to be escaped and code injected.

Impact

An attacker could run arbitrary JavaScript in an authenticated user's session to steal information or lure them to malicious sites, though the exploit only works for logged-in users.

What the attacker needed

Victim is authenticated; victim opens a crafted link

How it was found

  1. Open the crafted Google OAuth callback URL containing the malicious state parameter while logged in.
  2. The page reflects the state value into a script context, and the backslash escapes the closing quote.
  3. The injected JavaScript executes and shows an alert with the document location.

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 puts user input directly into a page without cleaning it, an attacker can sneak in their own code. Here, a special character (a backslash) let the attacker break out of a quoted string inside a script and run their own JavaScript. This only worked if the victim was already logged in.

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 strukt

View all

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