HomeCybersecurityDOM XSS Taint Flow: Sources, Sinks & Sanitization

DOM XSS Taint Flow: Sources, Sinks & Sanitization

Interactive DOM-based XSS defense simulator: watch untrusted input flow through Output Encoding, DOMPurify sanitization and CSP gates toward five real injection sinks (innerHTML, document.write, eval, event-handler attributes, javascript: URLs), and see live which specific defense actually stops which sink.

Cybersecurity3DModerate60 FPS
xss-protection ↗ Open standalone

This simulator models untrusted browser input as it flows toward five real DOM-based cross-site-scripting sinks — innerHTML, document.write(), eval(), an inline event-handler attribute, and a javascript: href — through a chain of three independently toggleable defenses: context-aware output encoding, DOMPurify-style HTML sanitization, and a strict Content-Security-Policy. Each payload particle is evaluated against the exact combination of sink and active defenses at the moment it launches, so switching a toggle mid-flight never rewrites a payload already in the air. The result surfaces the core lesson of DOM XSS defense: encoding, sanitization and CSP each cover a different execution context, and the sink you're protecting determines which one actually matters.

⚙ Under the hood

Watch untrusted browser input flow toward five real DOM-based XSS sinks through three toggleable defenses -- output encoding, DOMPurify sanitization and strict CSP -- and see live which specific defense actually stops which sink.

xssweb-securitydomcspsanitizationowasp

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)