Skip to content
OpenAdvisories
High · 7.6 CVE-2023-22461 EUVD-2023-0483GHSA-h857-2g56-468g

sanitize-svg Filter Bypass Allows Cross-Site Scripting (XSS)

Published Jan 4, 2023 · Updated Mar 10, 2025 · Assigned by GitHub_M

Description

The `sanitize-svg` package, a small SVG sanitizer to prevent cross-site scripting attacks, uses a deny-list-pattern to sanitize SVGs to prevent XSS. In doing so, literal `<script>`-tags and on-event handlers were detected in versions prior to 0.4.0. As a result, downstream software that relies on `sanitize-svg` and expects resulting SVGs to be safe, may be vulnerable to cross-site scripting. This vulnerability was addressed in v0.4.0. There are no known workarounds

Affected products

VendorProductAffectedFixed
mattkrick sanitize-svg < 0.4 —

Affected packages

EcosystemPackageAffectedFixedRecord
npm @mattkrick/sanitize-svg < 0.4.0 0.4.0 GHSA-h857-2g56-468g

References