Reflected XSS in Yahoo: A $700 Bug Bounty Write-Up

A URL path, a JavaScript popup, and a lesson in safe output handling.

In August 2017, while I was still getting started in bug bounty hunting, I discovered a reflected cross-site scripting (XSS) vulnerability affecting Yahoo’s movie pages on www.yahoo.com and ca.yahoo.com.

I’m Shahriar Khan, also known as TheShahzada, from Bangladesh. In this write-up, I’ll explain the affected URL pattern, how the proof-of-concept payload works, and the disclosure timeline that resulted in a $700 USD bounty.

What Is Reflected XSS?

Reflected XSS occurs when an application takes input from a request and includes it in a page in a way that allows the browser to execute attacker-controlled JavaScript.

Unlike stored XSS, the payload does not need to be saved as a comment or profile field. It arrives in a request, such as through a crafted URL, and is reflected into the resulting page. A typical attack requires someone to open that crafted link.

In this case, the injection point was part of the URL path, rather than a query parameter.

Affected URL Patterns

The original report identified the following routes:

https://www.yahoo.com/movies/film/[*]
https://ca.yahoo.com/movies/film/[*]

Here, [*] is a placeholder for the attacker-controlled path segment. It is not a literal part of the proof-of-concept URL.

The documented finding affected these movie routes on two Yahoo hosts. It does not establish that every page or subdomain was vulnerable.

The Proof-of-Concept Payload

The payload used in the original report was:

"><%2fscript><script>alert(document.domain)<%2fscript>

It combines an attempted HTML-context breakout with a script that displays the current document’s domain. The closing script tags use %2f, the percent-encoded form of the forward slash character /.

Breaking Down the Payload

Components of the original payload
ComponentPurpose
">Attempts to close a quoted attribute value and its surrounding HTML tag.
<%2fscript>Represents </script> after percent-decoding; attempts to close an existing script element.
<script>Opens a new script element.
alert(document.domain)Displays the current document’s domain in a JavaScript alert.
<%2fscript>Closes the injected script element after decoding.

For explanation, the percent-decoded form is:

"></script><script>alert(document.domain)</script>

This shows the intended structure of the payload. It does not identify the application’s exact decoding sequence or original HTML insertion point. Those implementation details were not captured in the published report.

Historical Reproduction Steps

  1. Start with one of the affected /movies/film/ routes.
  2. Append the original payload to the end of the path.
  3. Open the crafted URL in a browser.
  4. Observe the JavaScript alert displaying the document’s domain.
  5. Repeat against the second documented host to confirm the reported behavior there.

Original PoC URLs

The original examples are shown as text below:

https://www.yahoo.com/movies/film/"><%2fscript><script>alert(document.domain)<%2fscript>
https://ca.yahoo.com/movies/film/"><%2fscript><script>alert(document.domain)<%2fscript>

The observed alert demonstrated that the injected JavaScript executed in the affected page’s browser context.

Proof-of-Concept Screenshots

Yahoo — www.yahoo.com

Original reflected XSS proof-of-concept screenshot for www.yahoo.com
Figure 1 — Original proof of concept for the Yahoo www host.

Yahoo Canada — ca.yahoo.com

Original reflected XSS proof-of-concept screenshot for ca.yahoo.com
Figure 2 — Original proof of concept for the Yahoo Canada host.

What the Popup Demonstrated

alert(document.domain) provides a simple, visible demonstration of JavaScript execution. The important result is that input supplied through the URL was able to execute as code in the affected page.

Displaying the domain does not, by itself, demonstrate access to other Yahoo subdomains, account takeover, or stolen session data. Those would require separate evidence.

Potential Security Impact

Reflected XSS can allow a crafted link to execute JavaScript when a user opens it. Depending on the affected page and the user’s session, that code may be able to modify visible content, display deceptive interfaces, or access data exposed to JavaScript in that context.

The demonstrated impact in this report was JavaScript execution through a crafted URL. The original proof of concept did not establish cookie theft or account compromise.

Video Proof of Concept

The original video demonstration is embedded below:

Watch the original PoC on YouTube

Disclosure and Bounty Timeline

Report milestones — August 2017
DateEvent
Initial vulnerability report submitted.
Report triaged; initial $300 bounty awarded.
Vulnerability marked resolved.
Additional $400 bounty awarded.

Total bounty: $700 USD.

Lessons for Developers and Researchers

URL paths are untrusted input. Security checks should cover path segments as well as query parameters, form fields, and other request data.

Output handling must match the context. Applications should use safe rendering methods and context-appropriate encoding, and avoid inserting untrusted data into executable script contexts. Decoding or modifying data after protective processing can undermine those protections.

Encoding is not a security boundary. A percent-encoded character may be decoded during request processing. The presence of %2f in this payload does not, on its own, prove that a particular security filter was bypassed.

Keep impact claims tied to evidence. A clear reproduction, an explanation of execution context, and a concise PoC make a report easier to assess. A popup demonstrates execution; broader claims need additional validation.

These are general lessons from the vulnerability class. Yahoo’s specific code changes were not documented in the original write-up.

Final Thoughts

As someone new to bug bounty hunting at the time, this finding was an encouraging learning experience. It showed me that an ordinary URL path could be just as important to test as an obvious input field.

The most useful part was understanding the journey from user-controlled input to browser execution—and documenting it clearly enough for the security team to reproduce and resolve.

Keep learning, keep documenting, and keep sharing.

Written by

Further Reading

Share this field noteConnect on LinkedIn ↗

Discussion

Post a Comment

Discussion on Disqus

Blogger comments are available above. You can also load the existing Disqus discussion.