Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. enshrined/svg-sanitize
  4. ›
  5. CVE-2023-28426

CVE-2023-28426: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

March 20, 2023

savg-sanitizer is a PHP SVG/XML Sanitizer. A bypass has been found in versions prior to 0.16.0 that allows an attacker to upload an SVG with persistent cross-site scripting. HTML elements within CDATA needed to be sanitized correctly, as we were converting them to a textnode and therefore, the library wasn’t seeing them as DOM elements. This issue is fixed in version 0.16.0. Any data within a CDATA node will now be sanitised using HTMLPurifier. The maintainers have also removed many of the HTML and MathML elements from the allowed element list, as without ForiegnObject, they’re not legal within the SVG context. There are no known workarounds.

References

  • github.com/advisories/GHSA-xrqq-wqh4-5hg2
  • github.com/darylldoyle/svg-sanitizer/commit/cce18bc237c05c6e093e9672db7926788da9b322
  • github.com/darylldoyle/svg-sanitizer/security/advisories/GHSA-xrqq-wqh4-5hg2
  • nvd.nist.gov/vuln/detail/CVE-2023-28426

Code Behaviors & Features

Detect and mitigate CVE-2023-28426 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 before 0.16.0

Fixed versions

  • 0.16.0

Solution

Upgrade to version 0.16.0 or above.

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')

Source file

packagist/enshrined/svg-sanitize/CVE-2023-28426.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:40 +0000.