Skip to content
XSS Disclosed report Beginner

DOM XSS on https://www.███████

A page read the URL fragment and used it directly as the source of an iframe, so a crafted link could run JavaScript in the site's origin. An attacker could execute arbitrary JavaScript on another user who opened the link.

gamer7112 Follow

Originally disclosed on HackerOne

  • Triaged in 1 hour
  • Fixed in 58 days
  • Disclosed after 3 months

#Description DOM XSS can be achieved due to missing sanitation when setting the source of an iframe.

#POC

  1. Visit https://www.████frame.html#javascript:alert(document.domain)
  2. View alert

#Vulnerable Code

JavaScript
function Load()
{
	str=document.location.hash,idx=str.indexOf('#')
	if(idx>=0) str=str.substr(1);
	if(str) PPTSld.location.replace(str);
}

Impact

An attacker could execute arbitrary javascript on another user.

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

The page took the URL fragment and passed it to an iframe's location.replace without validating or sanitising it, allowing a javascript: URL to execute.

Impact

An attacker could execute arbitrary JavaScript on another user who opens a crafted link.

What the attacker needed

Victim clicks a crafted link

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 web page can read the part of the address after the # symbol, called the fragment. This page put that text straight into an iframe, which is an embedded window. Because the text was not checked, a link could make the iframe run JavaScript as if it came from the site itself.

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 gamer7112

View all

9 more disclosed reports, best first.

More from U.S. Dept Of Defense

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.