All CVEs / Sanitize-svg Project
CVE-2023-22461Sanitize-svg Project Sanitize-svg
Medium 6.1 No auth needed
Follow: this CVE · Sanitize-svg Project · Sanitize-svg Project Sanitize-svg We alert you by email or Slack (account required).
- Priority
- 52
- CVSS 3.1
- 6.1
- EPSS
- 0.6% probability of exploitation in 30 days · percentile 45
- Auth required
- No
- Published
- Jan 4, 2023
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
What happens
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
What to do
- Apply the vendor's security update for Sanitize-svg.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | @mattkrick/sanitize-svg |
< 0.4.0 |
0.4.0 |
npm install @mattkrick/sanitize-svg@0.4.0 |
Per OSV / GitHub Advisories (GHSA-h857-2g56-468g). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| sanitize-svg_project | sanitize-svg | < 0.4.0 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch Third Party Advisory
- github.com Exploit Third Party Advisory