When Support Portals Bite Back: DOM-XSS in a Helpcenter
A helpcentre page built its tunnel list by concatenating API-supplied host and IP values directly into HTML via jQuery.append, creating a DOM-XSS sink. An attacker who could control those API values could run JavaScript in the context of the support portal.
Published on medium.com
FREE LINK
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code used jQuery.append with string concatenation of untrusted API values instead of setting text content, so HTML in those values was interpreted.
Impact
The bug was not exploitable at the time because the API values were static infrastructure hosts, but if customers could register custom hostnames, attacker-controlled JavaScript could run for every visitor, enabling cookie theft, phishing, or defacement.
What the attacker needed
Attacker controls API host or IP values; victim visits the tunnel list article
The fix
The code should build elements and set their text content instead of concatenating strings into HTML, and a strict CSP should be added.
How it was found
- Open the public knowledgebase article that lists tunnels.
- Open the browser developer console.
- Paste a snippet that appends an image element with an onerror handler into the tunnel list.
- Observe the alert showing the document domain.
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 write-up has not been written yet. The Original tab links to the source.
The page took text from an API and glued it into the page's HTML without cleaning it. If that text contained HTML tags, the browser would treat them as real markup and run any script inside. The author proved this by pasting a small HTML snippet into the browser console and seeing an alert box appear.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.