NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Composer (PHP)

CVE-2025-55166: svg-sanitizer Bypasses Attribute Sanitization

mediumCVSS 4.0 5.1GHSA-22wq-q86m-83fh

Problem The sanitization logic at https://github.com/darylldoyle/svg-sanitizer/blob/0.21.0/src/Sanitizer.php#L454-L481 only searches for lower-case attribute names (e.g. xlink:href instead of xlink:HrEf), which allows to by-pass the isHrefSafeValue check. As a result this allows cross-site scripting or linking to external domains.

Published Aug 12, 2025

Affected packages

enshrined/svg-sanitize

Ecosystem
Composer (PHP)
Affected
< 0.22.0
Fixed in
0.22.0
Check
composer show enshrined/svg-sanitize

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

Problem

The sanitization logic at https://github.com/darylldoyle/svg-sanitizer/blob/0.21.0/src/Sanitizer.php#L454-L481 only searches for lower-case attribute names (e.g. xlink:href instead of xlink:HrEf), which allows to by-pass the isHrefSafeValue check. As a result this allows cross-site scripting or linking to external domains.

Proof-of-concept

_provided by azizk_

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100">
  
    <rect width="100" height="50" fill="red"></rect>
    <text x="50" y="30" text-anchor="middle" fill="white">Click me</text>
  
</svg>

Credits

The mentioned findings and proof-of-concept example were reported to the TYPO3 Security Team by the external security researcher azizk <[email protected]>.

Credited to ohader, realazizk.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More Composer (PHP) vulnerabilities

All Composer (PHP) entries