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

CVE-2026-45066: Symfony has an HtmlSanitizer allowLinkHosts() / allowMediaHosts() Bypass via URL-Parser Differentials and <area> Misclassification

mediumGHSA-qc95-4862-92fh

Description symfony/html-sanitizer lets applications sanitise untrusted HTML. The configuration methods allowLinkHosts([...]) and allowLinkSchemes([...]) are intended to restrict targets to an allowlist of hosts/schemes; allowMediaHosts() / allowMediaSchemes() do the same for etc. Three distinct bypasses allow a content author to smuggle off-allowlist URLs past these checks.

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/html-sanitizer lets applications sanitise untrusted HTML. The configuration methods allowLinkHosts([...]) and allowLinkSchemes([...]) are intended to restrict ` targets to an allowlist of hosts/schemes; allowMediaHosts() / allowMediaSchemes() do the same for ` etc.

Three distinct bypasses allow a content author to smuggle off-allowlist URLs past these checks. First, UrlSanitizer::parse() parses the input following RFC-3986, while browsers follow the WHATWG URL Standard which normalises \ to / before parsing the authority of "special" schemes; so an input like https://evil\@trusted.com/ parses with host trusted.com server-side but navigates to https://evil/ in the browser. Second, WHATWG collapses any run of / after the scheme into //, while RFC-3986 does not; so https:/evil.com/ and https:///evil.com/ parse as host-less (skipping the host allowlist) but resolve to evil.com in the browser. Third, UrlAttributeSanitizer checks 'a' === $element to route to the link policy and falls through to the media policy otherwise, but <area> is a navigable hyperlink equivalent to `; so was sanitised against the media policy (which typically allows data: and may have no host allowlist), bypassing allowLinkHosts() / allowLinkSchemes()` entirely.

Resolution

UrlSanitizer::sanitize() now rejects URLs that contain a backslash or that use a special scheme (http, https, ftp, ws, wss) followed by a single slash or three slashes before parsing, eliminating the parser-differential bypasses. UrlAttributeSanitizer now applies the link policy to both ` and ` elements.

The patch for this issue is available here for branch 5.4.

Credits

Symfony would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.

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