sanitize-svg Filter Bypass Allows Cross-Site Scripting (XSS)
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| mattkrick | sanitize-svg | before 0.4 | 0.4 | Patch available | CNA |
| — | @mattkrick/sanitize-svg (npm) | before 0.4.0 | 0.4.0 | Patch available | GHSA-h857-2g56-468g |
- sanitize-svg Vendormattkrick Affected before 0.4 Fixed in 0.4 Patch available CNA
- @mattkrick/sanitize-svg (npm) Vendor— Affected before 0.4.0 Fixed in 0.4.0 Patch available GHSA-h857-2g56-468g
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:sanitize-svg_project:sanitize-svg:*:*:*:*:*:node.js:*:* | before 0.4.0 | Vulnerable | Sanitize-svg Project |
- cpe:2.3:a:sanitize-svg_project:sanitize-svg:*:*:*:*:*:node.js:*:* Versions before 0.4.0 Vulnerable ·Sanitize-svg Project
Remediation
- Fix · CNA sanitize-svg (mattkrick) Fixed in 0.4
- Fix · GHSA-h857-2g56-468g @mattkrick/sanitize-svg (npm) Fixed in 0.4.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-22461
- 2026-10-03 Alias added: GHSA-h857-2g56-468g
References
Sources
- CVE-2023-22461 · CVE Program
- CVE-2023-22461 · NVD
- FIRST EPSS
- GHSA-h857-2g56-468g · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences