CVE-2023-22461
MEDIUM 6.1CVSS 3.1@mattkrick/sanitize-svg vulnerable to Cross-Site Scripting (XSS)
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
- Published
- 4 Jan 2023
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- GHSA-h857-2g56-468g
- Sources
- NVDJSONOSV GHSA-h857-2g56-468gJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.6 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | HIGH 7.6 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | sanitize-svg_project | sanitize-svgcpe:2.3:a:sanitize-svg_project:sanitize-svg:*:*:*:*:*:node.js:*:* |
< 0.4.0 | 0.4.0 |
| OSV | npm | @mattkrick/sanitize-svg | < 0.4.0 | 0.4.0 |
References
- https://github.com/mattkrick/sanitize-svg/commit/b107e453ede7b58adcccae74a3e474c012eec85d · Patch, Third Party Advisory, WEB
- https://github.com/mattkrick/sanitize-svg/security/advisories/GHSA-h857-2g56-468g · Exploit, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2023-22461 · ADVISORY
- https://github.com/mattkrick/sanitize-svg · PACKAGE
History
- 25 Nov 2026 20:35 UTC · NVD: first stored (published 4 Jan 2023)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 5 Jan 2023)