DOM XSS on 50x.html page
The 50x.html error page on duckduckgo.com takes a value from the URL query string and writes it into a DIV's innerHTML without proper sanitisation. An attacker could craft a link that runs JavaScript in the victim's browser on the duckduckgo.com origin.
- Triaged in 22 days
- Fixed in 42 days
- Disclosed after 42 days
Hello,
The is a DOM XSS vulnerability on https://duckduckgo.com/50x.html, it seems like the sink is DIV.innerHTML and the source is location.search. The PoC url is: https://duckduckgo.com/50x.html?e=&atb=test%22/%3E%3Cimg%20src=x%20onerror=alert(document.domain);%3E
The code that is causing this XSS is located in: https://duckduckgo.com/lib/l110.js Line 26, Column 60903
Below is the part of the vulnerable code:
b5.createElement("div")); cg = (m.exec(b7) || ["", ""])[1].toLowerCase(); b4 = R[cg] || R._default; ce.innerHTML = b4[1] + b7.replace(aB, "<$1></$2>") + b4[2]; cb = b4[0]; while (cb--) { ce=ce.lastChild } if(!bI.support.leadingWhitespace&&b2.test(b7))
Screenshot:

Impact
The attacker can execute JS code.
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 page passes a URL query parameter into a jQuery-style HTML parsing routine that assigns the result to innerHTML without sanitising it.
Impact
An attacker could execute JavaScript in the context of duckduckgo.com if a victim opens a crafted link.
What the attacker needed
Victim opens 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 parts of the address bar, such as the bit after the question mark. This page took that text and inserted it into the page as if it were HTML, so a crafted link could make the browser run script. That lets an attacker run code 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.