CVE-2025-55166: Enshrined/svg sanitize Svg-sanitizer Bypasses Attribute Sanitization Vulnerability
MODERATECVE-2025-55166 is a MODERATE svg-sanitizer bypasses attribute sanitization vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Enshrined/svg sanitize libraries in the Packagist ecosystem. The issue involves svg-sanitizer bypasses attribute sanitization. Remediation is available by upgrading affected packages to version 0.22.0.
CVE-2025-55166 at a Glance
How to Fix CVE-2025-55166
To remediate this vulnerability, upgrade all affected Enshrined/svg sanitize dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade enshrined/svg-sanitize to 0.22.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for enshrined/svg-sanitize
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-55166, inspect your project dependencies for Enshrined/svg sanitize:
inspect dependencies for enshrined/svg-sanitize
Analyze the terminal output to locate any version of Enshrined/svg sanitize in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.22.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Enshrined/svg sanitize, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-55166 Affected Enshrined/svg sanitize Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
enshrined/svg-sanitize
|
Packagist |
< 0.22.0
|
0.22.0
|
References
Frequently Asked Questions
What is CVE-2025-55166?
Which Enshrined/svg sanitize versions are affected?
What version fixes CVE-2025-55166?
Is enshrined/svg-sanitize affected?
What CWE is associated with CVE-2025-55166?
How can I check Packagist dependencies for CVE-2025-55166?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-22wq-q86m-83fh",
"modified" : "2025-08-12T20:20:59Z",
"published" : "2025-08-12T20:20:58Z",
"aliases" : [ "CVE-2025-55166" ],
"summary" : "svg-sanitizer Bypasses Attribute Sanitization",
"details" : "#### Problem\n\nThe 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.\n\n#### Proof-of-concept\n_provided by azizk_\n\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"100\" height=\"100\">\n <a xlink:hReF=\"javascript:alert(document.domain)\">\n <rect width=\"100\" height=\"50\" fill=\"red\"></rect>\n <text x=\"50\" y=\"30\" text-anchor=\"middle\" fill=\"white\">Click me</text>\n </a>\n</svg>\n```\n\n#### Credits\n\nThe mentioned findings and proof-of-concept example were reported to the TYPO3 Security Team by the external security researcher `azizk <medazizknani@gmail.com>`.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "enshrined/svg-sanitize"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.22.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/darylldoyle/svg-sanitizer/security/advisories/GHSA-22wq-q86m-83fh"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-55166"
}, {
"type" : "WEB",
"url" : "https://github.com/darylldoyle/svg-sanitizer/commit/0afa95ea74be155a7bcd6c6fb60c276c39984500"
}, {
"type" : "WEB",
"url" : "https://github.com/darylldoyle/svg-sanitizer/commit/5a0a1eaf0c6b0b540dc945fe30c93cf106b357c1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/darylldoyle/svg-sanitizer"
}, {
"type" : "WEB",
"url" : "https://github.com/darylldoyle/svg-sanitizer/blob/0.21.0/src/Sanitizer.php#L454-L481"
}, {
"type" : "WEB",
"url" : "https://github.com/darylldoyle/svg-sanitizer/releases/tag/0.22.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-12T20:20:58Z",
"nvd_published_at" : "2025-08-12T17:15:39Z"
}
}