SiteShadow
Back to vulnerability library

X01 XSS Risk

What this means

SiteShadow flagged code where untrusted input appears to flow into HTML/DOM sinks (places that can interpret it as markup or script).

Why it matters

Safer examples

1) Use text APIs, not HTML APIs (DOM)

// Good
el.textContent = userInput;

// Risky
// el.innerHTML = userInput;

2) If you must render HTML, sanitize with a well-known library

import DOMPurify from "dompurify";

el.innerHTML = DOMPurify.sanitize(userHtml);

3) Prefer frameworks' safe templating defaults

Most templating systems escape by default. Avoid "raw HTML" escape hatches unless you sanitize.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage