Summary
Symfony's HtmlSanitizer URL Attributes Pass Through BiDi Override Characters → Visual href Spoofing
Description
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.
Resolution
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.
The patch for this issue is available here for branch 5.4.
Credits
Symfony would like to thank Himanshu Anand for reporting the issue and Nicolas Grekas for providing the fix.
Impact
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
symfony/html-sanitizer to 6.4.40 or later; symfony/html-sanitizer to 7.4.12 or later; symfony/html-sanitizer to 8.0.12 or later; symfony/symfony to 6.4.40 or later; symfony/symfony to 7.4.12 or later; symfony/symfony to 8.0.12 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-45064? CVE-2026-45064 is a medium-severity security vulnerability in symfony/html-sanitizer (composer), affecting versions >= 6.1.0, < 6.4.40. It is fixed in 6.4.40, 7.4.12, 8.0.12.
- Which packages are affected by CVE-2026-45064?
symfony/html-sanitizer(composer) (versions >= 6.1.0, < 6.4.40)symfony/symfony(composer) (versions >= 6.1.0, < 6.4.40)
- Is there a fix for CVE-2026-45064? Yes. CVE-2026-45064 is fixed in 6.4.40, 7.4.12, 8.0.12. Upgrade to this version or later.
- Is CVE-2026-45064 exploitable, and should I be worried? Whether CVE-2026-45064 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-45064 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-45064?
- Upgrade
symfony/html-sanitizerto 6.4.40 or later - Upgrade
symfony/html-sanitizerto 7.4.12 or later - Upgrade
symfony/html-sanitizerto 8.0.12 or later - Upgrade
symfony/symfonyto 6.4.40 or later - Upgrade
symfony/symfonyto 7.4.12 or later - Upgrade
symfony/symfonyto 8.0.12 or later
- Upgrade