Live › technique › TECH-202610-svg-sanitizer-bypasses-six-of-eight-popular-svg-sanitizer-li
Go to dashboardPortSwigger Research (Gareth Heyes, 2026-10-27) bypassed 6 of 8 popular SVG sanitizers, so apps that accept SVG uploads and rely on them can serve stored XSS. Affected: mattkrick/sanitize-svg (XHTML namespace switch, foreignobject case bug, nested svg onload, XSLT), Borewit/svg-sanitizer (animate/set of href to javascript: URL), bgalek/safe-svg and alnorris/SVG-Sanitizer (xml-stylesheet processing instruction pointing to a data: URL XSLT stylesheet), cloudflare/svg-hush, jams2/py-svg-hush and bgalek/safe-svg (Safari <use> importing an uploaded GIF/image as SVG). Also shown: Firefox runs an XSLT stylesheet supplied in a Link response header even when the body is harmless XML. DOMPurify and darylldoyle/svg-sanitizer held up. The author says two unnamed popular applications were exploited. Proof of concept only; no in-the-wild use reported. Fix status per library: unknown.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-10-27 15:07 UTC. All times on this page are UTC.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| sanitize-svg | npm | – | – |
| svg-sanitizer | npm | – | – |
| safe-svg | – | – | – |
| SVG-Sanitizer | – | – | – |
| svg-hush | crates.io | – | – |
| py-svg-hush | PyPI | – | – |
Check if your app accepts SVG uploads and sanitizes them with sanitize-svg (mattkrick), svg-sanitizer (Borewit), safe-svg (bgalek), SVG-Sanitizer (alnorris), svg-hush (Cloudflare, Rust) or py-svg-hush; look in stored SVGs for xml-stylesheet processing instructions with data: URLs, <animate>/<set> on href, elements with an XHTML xmlns, and <use> pointing at uploaded image files
Switch SVG sanitizing to DOMPurify (SVG profile) or darylldoyle/svg-sanitizer, or watch for fixed releases of the affected libraries; serve user-uploaded SVGs from a separate sandbox domain with Content-Security-Policy: sandbox / script-src none and Content-Disposition: attachment, or convert them to raster images; strip xml-stylesheet processing instructions
Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
This page as .md · .json · in your agent: get_signal("TECH-202610-svg-sanitizer-bypasses-six-of-eight-popular-svg-sanitizer-li")