7.25.15
@comet/cms-api@7.25.15
Patch Changes
-
61d21ec: Validate uploaded SVGs with
DOMPurify(backed byjsdom) instead of the custom XML-based checkThe previous implementation parsed SVGs with
fast-xml-parserand applied a hand-written allow/deny list to reject scripts, event handlers and unsafe links.
SVGs are now sanitized with the vettedDOMPurifylibrary and rejected when it has to strip any tags or attributes, providing more robust protection against XSS vectors in uploaded SVGs.The
roleattribute and the<use>element are allowed, since they're commonly used in valid SVGs.<use>is restricted to same-document fragment references (e.g.href="#id"); references to external resources are rejected to prevent XSS/SSRF.