CVE-2026-45064: Symfony/html sanitizer Symfony's HtmlSanitizer URL Attributes Pass Vulnerability
MODERATECVE-2026-45064 is a MODERATE symfony's htmlsanitizer url attributes pass vulnerability (CWE-1007: Insufficient Visual Distinction of Homoglyphs Presented to User) affecting Symfony/html sanitizer libraries in the Packagist ecosystem. The issue involves symfony's htmlsanitizer url attributes pass through bidi override characters → visual href spoofing. Remediation is available by upgrading affected packages to version 6.4.40, 7.4.12, 8.0.12.
CVE-2026-45064 at a Glance
How to Fix CVE-2026-45064
To remediate this vulnerability, upgrade all affected Symfony/html sanitizer 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 symfony/html-sanitizer to 6.4.40
Upgrade symfony/html-sanitizer to 7.4.12
Upgrade symfony/html-sanitizer to 8.0.12
Upgrade symfony/symfony to 6.4.40
Upgrade symfony/symfony to 7.4.12
Upgrade symfony/symfony to 8.0.12
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for symfony/html-sanitizer
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-45064, inspect your project dependencies for Symfony/html sanitizer:
inspect dependencies for symfony/html-sanitizer
Analyze the terminal output to locate any version of Symfony/html sanitizer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.4.40), 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-1007: Insufficient Visual Distinction of Homoglyphs Presented to User, where the product displays information or identifiers to a user, but the display mechanism does not make it easy for the user to distinguish between visually similar or identical glyphs (homoglyphs), which may cause the user to misinterpret a glyph and perform an unintended, insecure action. In Symfony/html sanitizer, 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-2026-45064 Affected Symfony/html sanitizer Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
symfony/html-sanitizer
|
Packagist |
≥ 6.1.0
< 6.4.40
|
6.4.40
|
|
symfony/html-sanitizer
|
Packagist |
≥ 7.0.0
< 7.4.12
|
7.4.12
|
|
symfony/html-sanitizer
|
Packagist |
≥ 8.0.0
< 8.0.12
|
8.0.12
|
|
symfony/symfony
|
Packagist |
≥ 6.1.0
< 6.4.40
|
6.4.40
|
|
symfony/symfony
|
Packagist |
≥ 7.0.0
< 7.4.12
|
7.4.12
|
|
symfony/symfony
|
Packagist |
≥ 8.0.0
< 8.0.12
|
8.0.12
|
References
Frequently Asked Questions
What is CVE-2026-45064?
Which Symfony/html sanitizer versions are affected?
What version fixes CVE-2026-45064?
Is symfony/html-sanitizer affected?
Is symfony/symfony affected?
What CWE is associated with CVE-2026-45064?
How can I check Packagist dependencies for CVE-2026-45064?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h5vq-qfcg-4m6p",
"modified" : "2026-05-27T20:04:22Z",
"published" : "2026-05-27T20:04:22Z",
"aliases" : [ "CVE-2026-45064" ],
"summary" : "Symfony's HtmlSanitizer URL Attributes Pass Through BiDi Override Characters → Visual href Spoofing",
"details" : "### Description\n\n`Symfony\\Component\\HtmlSanitizer\\TextSanitizer\\UrlSanitizer::parse()` (used by `UrlSanitizer::sanitize()` and therefore by every `HtmlSanitizer` config that allows links or media) accepts URLs that contain Unicode explicit-direction BiDi formatting characters: U+202A–U+202E (LRE / RLE / PDF / LRO / RLO) and U+2066–U+2069 (LRI / RLI / FSI / PDI). These characters are passed through unchanged into the `href` / `src` attributes produced by `HtmlSanitizer`. When the resulting HTML is rendered in a browser, the override characters reverse or alter the visual ordering of the URL text, so the displayed link can differ arbitrarily from the actual destination: a classic visual-spoofing / phishing primitive against viewers of sanitized content.\n\n### Resolution\n\n`UrlSanitizer::parse()` now rejects URLs containing the explicit-direction BiDi formatting code points (U+202A–U+202E, U+2066–U+2069) before invoking the underlying URL parser. As an unrelated companion fix in the same patch, spaces inside path/query/fragment are now percent-encoded rather than rejected outright, while spaces in the scheme/authority remain rejected by the post-encoding whitespace check.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/743a435e948b897ef2b5564ac438d4beb95d2526) for branch 5.4.\n\n### Credits\n\nSymfony would like to thank Himanshu Anand for reporting the issue and Nicolas Grekas for providing the fix.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/html-sanitizer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.1.0"
}, {
"fixed" : "6.4.40"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/html-sanitizer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.4.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/html-sanitizer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.0.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.1.0"
}, {
"fixed" : "6.4.40"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.4.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.0.12"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/symfony/symfony/security/advisories/GHSA-h5vq-qfcg-4m6p"
}, {
"type" : "WEB",
"url" : "https://github.com/symfony/symfony/commit/743a435e948b897ef2b5564ac438d4beb95d2526"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/html-sanitizer/CVE-2026-45064.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45064.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/symfony/symfony"
}, {
"type" : "WEB",
"url" : "https://symfony.com/cve-2026-45064"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1007", "CWE-451" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-27T20:04:22Z",
"nvd_published_at" : null
}
}