NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Composer (PHP)

CVE-2026-45064: Symfony's HtmlSanitizer URL Attributes Pass Through BiDi Override Characters → Visual href Spoofing

mediumCVSS 4.0 6.9GHSA-h5vq-qfcg-4m6p

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

Published May 27, 2026

Affected packages

symfony/html-sanitizer

Ecosystem
Composer (PHP)
Affected
>= 6.1.0, < 6.4.40
Fixed in
6.4.40
Check
composer show symfony/html-sanitizer

symfony/html-sanitizer

Ecosystem
Composer (PHP)
Affected
>= 7.0.0, < 7.4.12
Fixed in
7.4.12
Check
composer show symfony/html-sanitizer

symfony/html-sanitizer

Ecosystem
Composer (PHP)
Affected
>= 8.0.0, < 8.0.12
Fixed in
8.0.12
Check
composer show symfony/html-sanitizer

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 6.1.0, < 6.4.40
Fixed in
6.4.40
Check
composer show symfony/symfony

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 7.0.0, < 7.4.12
Fixed in
7.4.12
Check
composer show symfony/symfony

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 8.0.0, < 8.0.12
Fixed in
8.0.12
Check
composer show symfony/symfony

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to nicolas-grekas, unknownhad.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More Composer (PHP) vulnerabilities

All Composer (PHP) entries