CVE-2026-45066: Symfony/html sanitizer Symfony Has An HtmlSanitizer AllowLinkHosts() Vulnerability
MODERATECVE-2026-45066 is a MODERATE symfony has an htmlsanitizer allowlinkhosts() vulnerability (CWE-436: Interpretation Conflict) affecting Symfony/html sanitizer libraries in the Packagist ecosystem. The issue involves symfony has an htmlsanitizer allowlinkhosts() / allowmediahosts() bypass via url-parser differentials and <area> misclassification. Remediation is available by upgrading affected packages to version 6.4.40, 7.4.12, 8.0.12.
CVE-2026-45066 at a Glance
How to Fix CVE-2026-45066
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-45066, 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-436: Interpretation Conflict, where product a handles inputs or steps differently than product b, which causes a to perform incorrect actions based on its perception of b's state. 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-45066 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-45066?
Which Symfony/html sanitizer versions are affected?
What version fixes CVE-2026-45066?
Is symfony/html-sanitizer affected?
Is symfony/symfony affected?
What CWE is associated with CVE-2026-45066?
How can I check Packagist dependencies for CVE-2026-45066?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qc95-4862-92fh",
"modified" : "2026-05-27T20:13:04Z",
"published" : "2026-05-27T20:13:04Z",
"aliases" : [ "CVE-2026-45066" ],
"summary" : "Symfony has an 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.",
"severity" : [ ],
"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-qc95-4862-92fh"
}, {
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-184", "CWE-436" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-27T20:13:04Z",
"nvd_published_at" : null
}
}