Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. enshrined/svg-sanitize
  4. ›
  5. CVE-2025-55166

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

August 12, 2025 (updated November 10, 2025)

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

References

  • github.com/advisories/GHSA-22wq-q86m-83fh
  • github.com/darylldoyle/svg-sanitizer
  • github.com/darylldoyle/svg-sanitizer/blob/0.21.0/src/Sanitizer.php
  • github.com/darylldoyle/svg-sanitizer/commit/0afa95ea74be155a7bcd6c6fb60c276c39984500
  • github.com/darylldoyle/svg-sanitizer/commit/5a0a1eaf0c6b0b540dc945fe30c93cf106b357c1
  • github.com/darylldoyle/svg-sanitizer/releases/tag/0.22.0
  • github.com/darylldoyle/svg-sanitizer/security/advisories/GHSA-22wq-q86m-83fh
  • nvd.nist.gov/vuln/detail/CVE-2025-55166

Code Behaviors & Features

Detect and mitigate CVE-2025-55166 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.22.0

Fixed versions

  • 0.22.0

Solution

Upgrade to version 0.22.0 or above.

Impact 5.4 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

packagist/enshrined/svg-sanitize/CVE-2025-55166.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:18 +0000.