Skip to content
XSS Disclosed report Intermediate

Content spoofing and potential Cross-Site Scripting vulnerability on www.hackerone.com

A third-party chat widget script loaded on the site handled cross-window messages without checking the sender's origin, and treated any message from the window that opened the page as trusted. An attacker could open the page from their own site and send crafted messages so the widget displayed attacker-chosen content, and possibly run script if the content security policy allowed it.

suresh1c Follow

Originally disclosed on HackerOne

Medium 4.2 View original
  • Triaged in 2 days
  • Fixed in 4 days
  • Paid in 3 days
  • Disclosed after 34 days

Summary: Hackerone.com using following script file https://js.driftt.com/include/1530431100000/hp9revvwkk62.js you can see the below script on page this.handleMessage=function(e){if(e&&e.data){var t=document.getElementById(Si);if(t&&(e.source===t.contentWindow||e.source===window.opener)){ handleMessage method used for handle the cross domain windows messaging

here missing validation of origin and the condition e.source===window.opener always true So attacker can handle all the events in that page

Steps To Reproduce

Pocurl: https://othertest45.azurewebsites.net/ddd.html Load the PoC url and enable popup always click the button on page it will trigger events and you can see modification on page

XSS may be blocked due to recent content security policy but url("javascript:alert(1);") is valid payload

To fix the issue remove the condition e.source===window.opener or validate the origin

Impact

Attacker can perform all the events and action given on that javascript page. and display vulnerable content or message it will damage the reputation of hackerone

The original report as published on HackerOne, by suresh1c. 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 message handler trusted any message coming from the window that opened the page, without verifying the sender's origin.

Impact

An attacker could trigger the widget's actions and display their own content or messages on the site, which could damage its reputation; script execution may be blocked by the content security policy.

What the attacker needed

Victim opens attacker page; popups allowed in browser; third-party widget script loaded

The fix

The handler should validate the origin of incoming messages and drop the check that treats any message from the opening window as trusted.

How it was found

  1. Host a page that opens the target site in a popup and sends messages to it.
  2. Allow popups in the browser and load the attacker page.
  3. Click the button on the attacker page to send the messages.
  4. Observe the content on the target page being changed.

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.

Web pages can talk to other windows they opened, or that opened them, by sending messages. The receiving page is supposed to check who sent each message before acting on it. Here that check was missing, so a page controlled by an attacker could send messages that the site's chat widget accepted and acted on, letting the attacker put their own text or content on the page.

What is XSS?

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

More from HackerOne

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.