Repository navigation
Security hardening and modernization release. Fully backward-compatible - no public API changes, and existing valid SVGs continue to pass validation.
🔒 Security
- Fixed
xlink:hrefJavaScript bypass.javascript:URLs delivered viaxlink:hrefon allow-listed elements (e.g.<image xlink:href="javascript:…">,<use xlink:href="javascript:…">) were not detected, because the underlying sanitizer protocol-filtershrefbut notxlink:href. These are now flagged. - CSS
url(javascript:…)detection is now case-insensitive and whitespace/quote-tolerant. Previouslyurl(JAVASCRIPT:…)andurl( 'javascript:…' )slipped through. <script>detection broadened. Tags using single quotes, extra attributes, uppercase, or unusual spacing (e.g.<script type='text/javascript'>,<SCRIPT>,< script >) — including those hidden inside<style>blocks — are now detected.- XXE / entity-expansion hardening for
withSyntaxValidation(): secure processing enabled; external general/parameter entities and external DTD loading disabled; XInclude disabled; entity-reference expansion disabled. External entities are no longer resolved (no file disclosure / SSRF) and nested-entity (billion-laughs) payloads no longer expand. Internal<!DOCTYPE>declarations remain allowed so legitimate SVGs still parse.
Full Changelog: v1.1.8...v1.2.0