dom-xss
Installation
SKILL.md
DOM-Based Cross-Site Scripting (XSS)
What Is Broken and Why
DOM XSS arises when client-side JavaScript takes data from a controllable source (URL fragment, query string, referrer, postMessage, cookie) and writes it to a dangerous sink that interprets HTML or executes code, all without the data ever being sent to or processed by the server. This means server-side output encoding does not prevent it, and proxy-based scanners may miss it entirely. The root cause is JavaScript treating user-controlled DOM properties as trusted content.
Key Signals
- JavaScript reading from:
location.hash,location.search,location.href,document.referrer,window.name,document.cookie,postMessageevent data - JavaScript writing to:
document.write(),innerHTML,outerHTML,insertAdjacentHTML,eval(),setTimeout(string),setInterval(string),location.href = ...,srcattribute assignment,jQuery.html(),jQuery.append() - Single-page applications (SPAs) with client-side routing
- JavaScript dynamically building page content from URL parameters
- Event handler attributes set from JavaScript using string-based eval-equivalent constructs