Skip to content

v1.2.0

Latest

Choose a tag to compare

@bgalek bgalek released this 12 Jun 22:59
· 22 commits to main since this release
00ad2a4

Security hardening and modernization release. Fully backward-compatible - no public API changes, and existing valid SVGs continue to pass validation.

🔒 Security

  • Fixed xlink:href JavaScript bypass. javascript: URLs delivered via xlink:href on allow-listed elements (e.g. <image xlink:href="javascript:…">, <use xlink:href="javascript:…">) were not detected, because the underlying sanitizer protocol-filters href but not xlink:href. These are now flagged.
  • CSS url(javascript:…) detection is now case-insensitive and whitespace/quote-tolerant. Previously url(JAVASCRIPT:…) and url( '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