The Woes of Sanitizing SVGs

Scratch's incremental approach to SVG sanitization has repeatedly failed, with new vulnerability classes discovered every 1-2 years (XSS via scripts, event handlers, HTTP leaks, CSS imports, and library bypasses), demonstrating that patching individual attack vectors is unsustainable and fundamentally flawed. This pattern illustrates a critical architectural risk for any IT organization handling user-generated content: attempting to whitelist safe content rather than eliminating dangerous operations at the source creates an endless vulnerability treadmill that wastes security resources and exposes systems to ongoing breach risk. Technology leaders should recognize this as a cautionary tale about the hidden costs of accepting and parsing untrusted input formats, and evaluate whether similar architectural decisions in their own applications present unacceptable security debt.

Hacker News3 min read
Read full article
The Woes of Sanitizing SVGs
Scratch's incremental approach to SVG sanitization has repeatedly failed, with new vulnerability classes discovered every 1-2 years (XSS via scripts, event handlers, HTTP leaks, CSS imports, and library bypasses), demonstrating that patching individual attack vectors is unsustainable and fundamentally flawed. This pattern illustrates a critical architectural risk for any IT organization handling user-generated content: attempting to whitelist safe content rather than eliminating dangerous operations at the source creates an endless vulnerability treadmill that wastes security resources and exposes systems to ongoing breach risk. Technology leaders should recognize this as a cautionary tale about the hidden costs of accepting and parsing untrusted input formats, and evaluate whether similar architectural decisions in their own applications present unacceptable security debt.