CVE-2025-55166
svg-sanitizer By-Passing Attribute Sanitization
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Active
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.1
svg-sanitizer By-Passing Attribute Sanitization
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.
- Record
CVE-2025-55166- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-79, CWE-601
- Updated
- 2026-11-02
EUVDEUVD-2025-24263
5.1
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.
- Record
EUVD-2025-24263- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-22wq-q86m-83fh
5.1
svg-sanitizer Bypasses Attribute Sanitization
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">
<a xlink:hReF="javascript:alert(document.domain)">
<rect width="100" height="50" fill="red"></rect>
<text x="50" y="30" text-anchor="middle" fill="white">Click me</text>
</a>
</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]>.
- Record
GHSA-22wq-q86m-83fh- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-79, CWE-601
- Updated
- 2026-11-02
NVD
5.1
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.
- Record
CVE-2025-55166- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-79, CWE-601
- Updated
- 2026-11-02
OSV
5.1
svg-sanitizer By-Passing Attribute Sanitization
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.
- Record
CVE-2025-55166- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-601, CWE-79
- Updated
- 2026-11-02
OSVGHSA-22wq-q86m-83fh
5.1
svg-sanitizer Bypasses Attribute Sanitization
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">
<a xlink:hReF="javascript:alert(document.domain)">
<rect width="100" height="50" fill="red"></rect>
<text x="50" y="30" text-anchor="middle" fill="white">Click me</text>
</a>
</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]>.
- Record
GHSA-22wq-q86m-83fh- CVSS 4.0
- 5.1 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-601, CWE-79
- Updated
- 2026-11-02
OSVCLSA-2026-1787820940 No score
TuxCare security update for enshrined/svg-sanitize (1 CVE)
TuxCare rebuilt enshrined/svg-sanitize to address 1 CVE. Fixed in 0.16.0-p1+tuxcare.
- Record
CLSA-2026-1787820940- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
enshrined/svg-sanitizePackagist |
before 0.22.0 | 0.22.0 |
enshrined/svg-sanitizeTuxCare:Packagist |
0.16.0 up to 0.16.0-p1+tuxcare | 0.16.0-p1+tuxcare |
enshrined/svg-sanitizePackagist |
before 0.22.0, plus listed versions 0.1.00.1.10.1.20.1.30.1.4 Show 42 moreShow less0.1.50.1.60.10.00.11.00.12.00.13.00.13.10.13.20.13.30.14.00.14.10.15.00.15.10.15.20.15.30.15.40.16.00.17.00.18.00.19.00.2.00.2.10.20.00.21.00.3.00.4.00.4.10.5.00.5.10.5.20.5.30.5.3.10.6.00.7.00.7.10.7.20.8.00.8.10.8.20.9.00.9.10.9.2 |
0.22.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-55166 is a medium vulnerability (CVSS 5.1) in Darylldoyle Svg-sanitizer, published August 12, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.54%, the 45th percentile. Fixed in enshrined/svg-sanitize 0.22.0.
References
github.com/darylldoyle/svg-sanitizer/security/advisories/GHSA-22wq-q86m-83fh
github.com/darylldoyle/svg-sanitizer/commit/5a0a1eaf0c6b0b540dc945fe30c93cf106b357c1
nvd.nist.gov/vuln/detail/CVE-2025-55166
github.com/darylldoyle/svg-sanitizer/commit/0afa95ea74be155a7bcd6c6fb60c276c39984500
github.com/darylldoyle/svg-sanitizer/blob/0.21.0/src/Sanitizer.php
github.com/darylldoyle/svg-sanitizer/releases/tag/0.22.0
github.com/advisories/GHSA-22wq-q86m-83fh
github.com/CVEProject/cvelistV5/tree/main/cves/2025/55xxx/CVE-2025-55166.json
github.com/darylldoyle/svg-sanitizer