# CVE-2023-22461: sanitize-svg Filter Bypass Allows Cross-Site Scripting (XSS)

- Severity: High 7.6 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.61%, higher than 50% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-01-04T14:57:04.902Z
- Modified: 2026-06-17T05:35:30.200Z
- Also known as: GHSA-h857-2g56-468g
- Weaknesses: CWE-79, CWE-80
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- 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

(As written by CVE List.)

## Affected

- mattkrick sanitize-svg: < 0.4
- @mattkrick/sanitize-svg (npm): before 0.4.0
- sanitize-svg_project sanitize-svg: before 0.4.0

## Every score

- GitHub_M: CVSS:3.1 7.6 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N`
- GitHub: CVSS:3.1 7.6 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/mattkrick/sanitize-svg/security/advisories/GHSA-h857-2g56-468g> (exploit, third-party-advisory, web)
- <https://github.com/mattkrick/sanitize-svg/commit/b107e453ede7b58adcccae74a3e474c012eec85d> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-22461> (advisory)
- <https://github.com/mattkrick/sanitize-svg> (package)

## Sources

- CVE List: [CVE-2023-22461](https://www.cve.org/CVERecord?id=CVE-2023-22461), CVE Terms of Use, modified 2025-03-10
- GitHub Advisory Database: [GHSA-h857-2g56-468g](https://github.com/advisories/GHSA-h857-2g56-468g), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2023-22461](https://nvd.nist.gov/vuln/detail/CVE-2023-22461), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-22461 · Whole record: https://cve.day/CVE-2023-22461.json · Rebuilt by cve.day 2026-11-25T22:58:21.480Z
