CVE-2025-55166 svg-sanitizer By-Passing Attribute Sanitization

Medium 5.1 Published Updated

Attackers can bypass attribute sanitization in the PHP SVG sanitizer to inject malicious scripts or links, leading to XSS or open redirects.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-55166?

CVE-2025-55166 is a medium-severity cross-site scripting vulnerability in darylldoyle svg-sanitizer, published on 12 Aug 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

savg-sanitizer is a PHP SVG/XML sanitizer. Prior to version 0.22.0, the sanitization logic in the cleanXlinkHrefs method only searches for lower-case attribute name, which allows to by-pass the isHrefSafeValue check. As a result this allows cross-site scripting or linking to external domains. This issue has been patched in version 0.22.0.

Weakness: CWE-79, CWE-601

Which versions are affected by CVE-2025-55166?

2 open source packages ship an affected version, including enshrined/svg-sanitize.

PackageAffectedFixed in
enshrined/svg-sanitize PackagistAll versions0.22.0
enshrined/svg-sanitize PackagistAll versions0.22.0

How do I fix CVE-2025-55166?

Upgrade enshrined/svg-sanitize to 0.22.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-55166 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-55166 exists.

Sources

Also known as CLSA-2026-1787820940, GHSA-22wq-q86m-83fh.

Is CVE-2025-55166 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free