CVE-2025-55166: Enshrined/svg sanitize Svg-sanitizer Bypasses Attribute Sanitization Vulnerability

MODERATE
Advisory Identifier: GHSA-22wq-q86m-83fh
CWE-601 CWE-79
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2025-55166
GHSA Identifier GHSA-22wq-q86m-83fh
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Enshrined/svg sanitize
Package Ecosystem Packagist
Published Date
Last Updated

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.

enshrined/svg-sanitize fixed: 0.22.0
Upgrade enshrined/svg-sanitize to 0.22.0
Verify Direct and Transitive Dependencies

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

#### 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 <medazizknani@gmail.com>`.

CVE-2025-55166 Affected Enshrined/svg sanitize Versions

1 component(s)
Fixed Versions:
0.22.0
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?
CVE-2025-55166 is a security vulnerability in Enshrined/svg sanitize involving svg-sanitizer Bypasses Attribute Sanitization under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Enshrined/svg sanitize versions are affected?
Affected versions include releases prior to 0.22.0 across affected packages: enshrined/svg-sanitize.
What version fixes CVE-2025-55166?
Upgrading to 0.22.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is enshrined/svg-sanitize affected?
Yes, enshrined/svg-sanitize is affected in releases prior to 0.22.0. Upgrade your dependency to 0.22.0 or later.
What CWE is associated with CVE-2025-55166?
CVE-2025-55166 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Packagist dependencies for CVE-2025-55166?
Run the dependency tree command: 'inspect dependencies for enshrined/svg-sanitize'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}