{"id":"CVE-2026-45066","aliases":["GHSA-qc95-4862-92fh"],"url":"https://o3.security/vulnerability/CVE-2026-45066","summary":"Symfony: HtmlSanitizer allowLinkHosts() / allowMediaHosts() Bypass via URL-Parser Differentials and <area> Misclassification","details":"### Description\n\n`symfony/html-sanitizer` lets applications sanitise untrusted HTML. The configuration methods `allowLinkHosts([...])` and `allowLinkSchemes([...])` are intended to restrict `<a href>` targets to an allowlist of hosts/schemes; `allowMediaHosts()` / `allowMediaSchemes()` do the same for `<img src>` etc.\n\nThree 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 `<a>`; so `<area href>` was sanitised against the media policy (which typically allows `data:` and may have no host allowlist), bypassing `allowLinkHosts()` / `allowLinkSchemes()` entirely.\n\n### Resolution\n\n`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 `<a>` and `<area>` elements.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/d506b556d3d3906f3e8660ad82257ce87edbaac4) for branch 5.4.\n\n### Credits\n\nSymfony would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.","published":"2026-07-14T17:53:49.836Z","modified":"2026-08-12T03:51:23.805301196Z","cvss":null,"epss":{"score":0.00338,"percentile":0.27144,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"8.0.12"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"8.0.12"}],"fix":{"url":"https://github.com/symfony/symfony/commit/d506b556d3d3906f3e8660ad82257ce87edbaac4","label":"symfony/symfony@d506b55"},"references":[{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v6.4.40"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v7.4.12"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v8.0.12"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45066.json"},{"type":"ADVISORY","url":"https://github.com/symfony/symfony/security/advisories/GHSA-qc95-4862-92fh"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45066"},{"type":"FIX","url":"https://github.com/symfony/symfony/commit/d506b556d3d3906f3e8660ad82257ce87edbaac4"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/html-sanitizer/CVE-2026-45066.yaml"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45066.yaml"},{"type":"PACKAGE","url":"https://github.com/symfony/symfony"},{"type":"WEB","url":"https://symfony.com/cve-2026-45066"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:23.805301196Z"}}