Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @mattkrick/sanitize-svg
  4. ›
  5. CVE-2023-22461

CVE-2023-22461: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

January 5, 2023

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

References

  • github.com/advisories/GHSA-h857-2g56-468g
  • github.com/mattkrick/sanitize-svg/commit/b107e453ede7b58adcccae74a3e474c012eec85d
  • github.com/mattkrick/sanitize-svg/security/advisories/GHSA-h857-2g56-468g
  • nvd.nist.gov/vuln/detail/CVE-2023-22461

Code Behaviors & Features

Detect and mitigate CVE-2023-22461 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 0.3.1

Fixed versions

  • 0.4.0

Solution

Upgrade to version 0.4.0 or above.

Impact 6.1 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
  • CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

Source file

npm/@mattkrick/sanitize-svg/CVE-2023-22461.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:39 +0000.