Skip to content
XSS Write-up Intermediate

XSS on The MOST Popular Movie Ticket website.

A parameter called strException in a request from Paytm to the main website was reflected without encoding, allowing an attacker to inject an SVG with an onload handler. The attacker could execute JavaScript in the victim's browser, though Cloudflare initially blocked simpler payloads.

Tarang Parmar Follow

Published on medium.com

This is the first time I was writing this blog, so I will let you know the story of how I got the XSS on one of the popular entertaining websites.

Tarang Parmar, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target is a popular movie ticket website, referred to in the report as REDACTED.com. The site sells movie tickets and related items such as popcorn, and the researcher learned from a friend on social media that it gave free credit points to people who found vulnerabilities, which could be spent on the site.

The feature that turned out to be vulnerable was a donation campaign. A logged-in user could donate an amount in Indian rupees (INR), pay through Paytm, and then be redirected back to the main website once the payment was complete.

Setup

The researcher used a normal account on the website, logged in, and started a donation of 1 INR. The report does not name any specific tool; it only describes modifying requests. The only precondition is an authenticated session on the donation flow, plus the ability to modify the request that Paytm sends back to the main website.

Finding it

The researcher spent about two hours looking for vulnerable points on the site without success, then noticed the donation campaign option and decided to try it.

The first approach was to understand how the application processes the request and serves the response: the application takes the amount, asks the user to pay through Paytm, and after payment redirects back to the main website.

The next step was to inject payloads into values such as name, email, refcode, bankid and POSTURL. Nothing worked. The researcher then changed approach: instead of modifying the request going from the main website to Paytm, they started modifying the request coming from Paytm back to the main website. In that request there was a parameter called strException, and the researcher was able to inject "> into it without it being encoded in the response.

Exploitation

Step 1: confirm the injection point

The parameter strException in the Paytm-to-website callback reflected the "> sequence unencoded. That was enough to show the value was being placed into the response without proper output encoding.

Step 2: try the master payload

The first payload tried was the classic:

HTML
<script>Alert(1)</script>

It was blocked by Cloudflare.

Step 3: search for a WAF bypass

The researcher searched Google for Cloudflare bypasses, noting that most of the commonly published payloads were already patched or blocked. They then moved to the site https://bugbountytip.tech and searched for "Cloudflare bypass", which returned a payload that was taken as the bypass:

HTML
<svg onload=alert&#0000000040"1")>

The expectation was that this would also be blocked, but it passed the WAF and was injected without any blockage. The researcher notes that it looked like it might not work, but it was a valid payload.

Step 4: fit the payload into the request

The payload then had to be balanced with the surrounding request. The original request contained:

HTML
<input type=”hidden” name=”strException” value=”<Value>”>

Applying the value directly produced:

HTML
<input type=”hidden” name=”strException” value=”<svg onload=alert&#0000000040"1")>”>

This did not work.

Step 5: break out of the attribute

The payload was adjusted by adding "> at the beginning and < at the end, which separates the injected code from the surrounding markup:

HTML
<input type=”hidden” name=”strException” value=”"> <svg onload=alert&#0000000040"1")><””>

With this modification the payload finally worked.

Root cause

The strException parameter from the Paytm callback is reflected into the response without output encoding, inside an input tag's value attribute. The "> sequence closes the value attribute and the input tag, allowing new markup to be introduced. Cloudflare's WAF blocked the obvious <script> payload but did not block the <svg onload=...> variant, Cloudflare's WAF blocked the obvious <script> payload but did not block the <svg onload=...> variant.. The report does not describe any server-side encoding or validation of strException.

Impact

The report demonstrates script execution in the context of the movie ticket website through the donation payment callback. The researcher's own framing is that this was an XSS on a popular entertainment website, found through the donation flow.

Fix

The appropriate fix is to apply context-aware output encoding to strException (and any other callback parameters) before rendering it into HTML, and to validate or reject unexpected characters rather than relying on the WAF alone.

Variants to test

  1. Payment callback parameters. On other sites with third-party payment redirects, intercept the request coming back from the payment provider and inject "> into every parameter. A positive result is the sequence appearing unencoded in the response.
  2. WAF bypass payloads. When a <script> payload is blocked, try alternative tags and encodings such as <svg onload=...> with numeric character references. A positive result is the payload passing the WAF and executing.
  3. Attribute context breakouts. Where a value is reflected inside an attribute, try prefixing with "> and suffixing with < to close the attribute and tag. A positive result is the injected markup rendering as HTML rather than text.
  4. Other donation or checkout fields. Test name, email, refcode, bankid and POSTURL as the researcher did, both in the outbound request and the inbound callback. A positive result is any of them reflecting unencoded into the response.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A security researcher found a way to inject HTML and JavaScript into a popular movie ticket website by manipulating a payment callback. This kind of flaw is called cross-site scripting, or XSS. The site had a donation feature: you could donate a small amount of money, pay through Paytm (a payment service), and then be sent back to the movie site. The researcher discovered that one of the values sent back from Paytm to the movie site was being placed into the web page without being cleaned up. That let them insert their own HTML and JavaScript. A web firewall (Cloudflare) blocked the obvious attack, but the researcher found a different payload that slipped past it. This article walks through the whole story from the beginning, explaining every term as it comes up.

Background: the website and the feature

The target is a popular website that sells movie tickets and related items like popcorn. The researcher learned from a friend on social media that the site gave free credit points to people who found vulnerabilities, which could be spent on the site. The researcher refers to the site as REDACTED.com.

The feature that turned out to be vulnerable was a donation campaign. A logged-in user could donate an amount in Indian rupees (INR), pay through Paytm, and then be redirected back to the main website once the payment was complete.

To follow the story, you need a few basic ideas:

  • HTML is the language that describes the structure of a web page. It uses tags like <input> to create form fields, and attributes like value="..." to give them initial content.
  • JavaScript is code that runs in your browser and can make a page do things (show alerts, read data, send requests).
  • A web application is a website that does more than show static pages: it takes your input, stores it, and responds dynamically. The movie ticket site is a web application.
  • A request is a message your browser sends to a server asking for something (a page, a payment, a form submission). A response is the server's reply.
  • A parameter is a named piece of data inside a request, like name=Alice or amount=1. Parameters are how web applications receive values from users and from other systems.
  • A payment gateway like Paytm is a third-party service that handles the money part. The movie site sends you to Paytm, you pay, and Paytm sends you back to the movie site with a message saying whether the payment succeeded. That return message is called a callback.
  • A web application firewall (WAF) is a filter that sits in front of a website and inspects incoming requests, blocking ones that look malicious. Cloudflare is a popular WAF provider.
  • Cross-site scripting (XSS) is a vulnerability where an attacker can get their own JavaScript to run in another user's browser as if it came from the trusted website. That lets the attacker do things the site's own code could do: read data from the page, act as the user, or redirect them.
  • Output encoding (or escaping) is the defence: when a web application places user-supplied data into an HTML page, it should convert special characters like <, >, " into safe representations so they are displayed as text rather than interpreted as code. If encoding is missing, injected markup can break out and run.

Setting up

The researcher used a normal account on the website, logged in, and started a donation of 1 INR. The report does not name any specific tool; it only describes modifying requests. The only precondition is an authenticated session on the donation flow, plus the ability to modify the request that Paytm sends back to the main website.

An intercepting proxy is a tool that sits between your browser and the internet, letting you pause, inspect, and change requests and responses before they go through. Think of it as a mail room where you can open letters, read them, and rewrite them before they are delivered. You do not need to know which proxy was used; the point is that the researcher could see and edit the traffic.

Finding it

The researcher spent about two hours looking for vulnerable points on the site without success, then noticed the donation campaign option and decided to try it.

The first approach was to understand how the application processes the request and serves the response: the application takes the amount, asks the user to pay through Paytm, and after payment redirects back to the main website.

The next step was to inject payloads into values such as name, email, refcode, bankid and POSTURL. Nothing worked. The researcher then changed approach: instead of modifying the request going from the main website to Paytm, they started modifying the request coming from Paytm back to the main website. In that request there was a parameter called strException, and the researcher was able to inject "> into it without it being encoded in the response.

Why try those fields? Because any place where the application accepts data and later shows it back is a candidate for XSS. The researcher was probing the outbound direction (movie site to Paytm) first, which is the more obvious path. When that failed, they flipped to the inbound direction (Paytm back to the movie site). That callback is often less carefully checked because it comes from a trusted partner, but it still carries data that the movie site will display.

The key observation was that the two characters "> appeared in the response exactly as typed, not turned into &quot;&gt; or similar. That is the sign of missing output encoding. In HTML, a double quote " ends an attribute value, and > ends a tag. So if you can inject ">, you can close whatever attribute and tag you are inside and start writing your own HTML.

Exploitation

Step 1: confirm the injection point

The parameter strException in the Paytm-to-website callback reflected the "> sequence unencoded. That was enough to show the value was being placed into the response without proper output encoding.

Reflected means the application takes your input and echoes it back in the response. If it comes back unchanged, you have a way to insert characters that the page will interpret as structure rather than text.

Step 2: try the master payload

The first payload tried was the classic:

HTML
<script>Alert(1)</script>

It was blocked by Cloudflare.

Line by line:

  • <script> opens a script tag. Everything until </script> is treated as JavaScript code by the browser.
  • Alert(1) is a call to the browser's alert function (JavaScript is case-sensitive, so Alert with a capital A is not the built-in alert; in practice this would likely throw an error, but the point of the test is to see whether the tag itself is allowed through).
  • </script> closes the script tag.

If this had been reflected unencoded, the browser would have tried to run it. Instead, Cloudflare recognised the pattern and blocked the request. That told the researcher a WAF was in the path.

Step 3: search for a WAF bypass

The researcher searched Google for Cloudflare bypasses, noting that most of the commonly published payloads were already patched or blocked. They then moved to the site https://bugbountytip.tech and searched for "Cloudflare bypass", which returned a payload that was taken as the bypass:

HTML
<svg onload=alert&#0000000040"1")>

The expectation was that this would also be blocked, but it passed the WAF and was injected without any blockage. The researcher notes that it looked like it might not work, but it was a valid payload.

Why does this payload look strange? Let's break it down:

  • <svg ...> opens an SVG element. SVG is a way to draw graphics in HTML, and it supports an onload attribute that runs JavaScript when the element loads.
  • onload=alert&#0000000040"1") is the event handler. The value is not quoted in the usual way; instead it uses a numeric character reference &#0000000040 to represent the @ character. Numeric character references are a way to write a character by its code point. The browser decodes them before running the JavaScript, so the WAF sees a different string than the browser does. That is the bypass trick: the WAF's pattern matching does not recognise the decoded form.
  • The exact payload as given is <svg onload=alert&#0000000040"1")>. The researcher notes it was a valid payload that passed the WAF.

A WAF bypass means finding a way to make a malicious request that the firewall does not recognise as malicious, while the browser still interprets it as code. It is like getting a prohibited item through security by disguising it so the scanner does not match its known signatures.

Step 4: fit the payload into the request

The payload then had to be balanced with the surrounding request. The original request contained:

HTML
<input type=”hidden” name=”strException” value=”<Value>”>

Applying the value directly produced:

HTML
<input type=”hidden” name=”strException” value=”<svg onload=alert&#0000000040"1")>”>

This did not work.

Line by line for the original:

  • <input starts a form input element.
  • type=”hidden” makes it a hidden field: the user does not see it, but it is part of the form and its value is submitted.
  • name=”strException” gives the field its name, which is how the server identifies the parameter.
  • value=”<Value>” is the initial content. The <Value> here is a placeholder for whatever the server puts in; in the real page it would be the value of strException.
  • > closes the tag.

When the researcher put the SVG payload directly into value, the browser saw the whole thing as the value of the value attribute, because the attribute was still open. The <svg> was treated as text inside the attribute, not as a new tag. That is why it did not execute.

Step 5: break out of the attribute

The payload was adjusted by adding "> at the beginning and < at the end, which separates the injected code from the surrounding markup:

HTML
<input type=”hidden” name=”strException” value=”"> <svg onload=alert&#0000000040"1")><””>

With this modification the payload finally worked.

Line by line:

  • value=” opens the attribute value.
  • "> immediately closes the attribute (the ") and closes the input tag (the >). Now the browser is outside the tag and ready to read new HTML.
  • (space) separates.
  • <svg onload=alert&#0000000040"1")> is the SVG payload, now sitting as a real element in the page, so its onload runs.
  • <””> is extra markup added to balance the remaining quotes and angle brackets so the rest of the page does not break. The researcher describes it as separating the code from the code.

In plain terms: the original page had a hidden input whose value was filled from strException. By starting the value with ">, the researcher closed the attribute and the tag early, then inserted a new SVG element. The trailing <””> tidies up the leftover characters so the page still parses. The browser now sees an SVG element with an onload handler, and the JavaScript runs.

Root cause

The strException parameter from the Paytm callback is reflected into the response without output encoding, inside an input tag's value attribute. The "> sequence closes the value attribute and the input tag, allowing new markup to be introduced. Cloudflare's WAF blocked the obvious <script> payload but did not block the <svg onload=...> variant, Cloudflare's WAF blocked the obvious <script> payload but did not block the <svg onload=...> variant.. The report does not describe any server-side encoding or validation of strException.

In other words, the application trusted the callback data and inserted it raw into the page. The only thing standing between the attacker and execution was the WAF, and the WAF's pattern matching could be evaded with an alternative encoding.

Impact

The report demonstrates script execution in the context of the movie ticket website through the donation payment callback. The researcher's own framing is that this was an XSS on a popular entertainment website, found through the donation flow.

Why does this matter? If an attacker can make a victim's browser run the attacker's JavaScript on the movie site, that script runs with the site's privileges. It could read the page, make requests as the user, or redirect them. The report stops at the alert proof of concept and does not explore those consequences.

Fix

The appropriate fix is to apply context-aware output encoding to strException (and any other callback parameters) before rendering it into HTML, and to validate or reject unexpected characters rather than relying on the WAF alone.

Context-aware output encoding means encoding data differently depending on where it will appear: inside an HTML attribute, inside a script block, inside a URL, and so on. For an attribute value, characters like ", ', <, > and & should be converted to their safe HTML entities so they are displayed as text and cannot break out. Relying on a WAF alone is risky because WAFs can be bypassed, as this case shows.

Variants to test

  1. Payment callback parameters. On other sites with third-party payment redirects, intercept the request coming back from the payment provider and inject "> into every parameter. A positive result is the sequence appearing unencoded in the response.
  2. WAF bypass payloads. When a <script> payload is blocked, try alternative tags and encodings such as <svg onload=...> with numeric character references. A positive result is the payload passing the WAF and executing.
  3. Attribute context breakouts. Where a value is reflected inside an attribute, try prefixing with "> and suffixing with < to close the attribute and tag. A positive result is the injected markup rendering as HTML rather than text.
  4. Other donation or checkout fields. Test name, email, refcode, bankid and POSTURL as the researcher did, both in the outbound request and the inbound callback. A positive result is any of them reflecting unencoded into the response.

Glossary

  • HTML: the language that describes the structure of a web page, using tags and attributes.
  • JavaScript: code that runs in the browser and can make a page interactive or perform actions.
  • Web application: a website that processes input and responds dynamically, rather than serving static pages only.
  • Request: a message from a browser (or another system) to a server asking for something.
  • Response: the server's reply to a request.
  • Parameter: a named piece of data in a request, like name=Alice.
  • Payment gateway: a third-party service that handles payments, such as Paytm.
  • Callback: the return message from a payment gateway back to the merchant site after a payment.
  • Web application firewall (WAF): a filter in front of a website that inspects requests and blocks malicious ones.
  • Cloudflare: a popular WAF and content delivery network provider.
  • Cross-site scripting (XSS): a vulnerability where an attacker's JavaScript runs in another user's browser as if it came from the trusted site.
  • Output encoding (escaping): converting special characters in data into safe representations so they are displayed as text, not interpreted as code.
  • Intercepting proxy: a tool that sits between browser and internet, allowing requests and responses to be paused, inspected, and modified.
  • Reflected: input that is echoed back in the response.
  • Attribute: a property of an HTML tag, like value="..." on an <input>.
  • Tag: an HTML element marker like <input> or <svg>.
  • SVG: a format for drawing graphics in HTML, which supports event handlers like onload.
  • Event handler: code that runs when something happens, like onload when an element loads.
  • Numeric character reference: a way to write a character by its code point, like &#0000000040 for @.
  • WAF bypass: finding a request that the WAF does not recognise as malicious but the browser still executes.
  • Context-aware output encoding: encoding data differently depending on where it will appear (attribute, script, URL, etc.).
  • Proof of concept (PoC): a demonstration that a vulnerability exists, often using an alert.
  • Alert: a browser function that shows a pop-up dialog, commonly used to prove JavaScript execution.

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.