MediumGHSA-fqx8-v33p-4qccCVE-2022-23638

Cross-site Scripting in enshrined/svg-sanitize

Published 14 Feb 2022 · Updated 16 Feb 2024

Is your project on an affected enshrined/svg-sanitize?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<0.15.0
Fixed in
0.15.0
Update to the fixed version for your release line, for example:composer require enshrined/svg-sanitize:^0.15.0

Details

Impact

SVG sanitizer library before version 0.15.0 did not remove HTML elements wrapped in a CDATA section. As a result, SVG content embedded in HTML (fetched as text/html) was susceptible to cross-site scripting. Plain SVG files (fetched as image/svg+xml) were not affected.

Patches

This issue is fixed in 0.15.0 and higher.

Workarounds

There is currently no workaround available without upgrading.

For more information

If you have any questions or comments about this advisory:

  • Open an issue in Github
  • Email us at [daryll@enshrined.co.uk](mailto:daryll@enshrined.co.uk)

Is GHSA-fqx8-v33p-4qcc in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected enshrined/svg-sanitize, and gives you the command that fixes it.

More advisories for enshrined/svg-sanitize

  • MediumCVE-2026-107380enshrined/svg-sanitize: Stored XSS via DTD Entity / HTML5 Named Character Reference Collision · 8 Oct 2026
  • MediumCVE-2026-107381svg-sanitizer: Mixed-case xlink:HrEf skips the `<use>` nesting-DoS check in Resolver::processReferences · 8 Oct 2026
  • MediumCVE-2026-107379enshrined/svg-sanitize: Denial of Service via DTD Attribute Declaration Crash · 8 Oct 2026
  • MediumCVE-2025-55166svg-sanitizer Bypasses Attribute Sanitization · 12 Aug 2025
  • MediumCVE-2019-10772Sanitizer bypass in svg-sanitizer · 27 Feb 2020
  • HighCVE-2019-18857XSS in enshrined/svg-sanitize due to mishandled script and data values in attributes · 8 Jan 2020
enshrined/svg-sanitize security overview

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.