Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. symfony/html-sanitizer
  4. ›
  5. CVE-2026-45066

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

May 27, 2026

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.

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 <a>; so <area href> was sanitised against the media policy (which typically allows data: and may have no host allowlist), bypassing allowLinkHosts() / allowLinkSchemes() entirely.

References

  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/html-sanitizer/CVE-2026-45066.yaml
  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45066.yaml
  • github.com/advisories/GHSA-qc95-4862-92fh
  • github.com/symfony/symfony/security/advisories/GHSA-qc95-4862-92fh
  • nvd.nist.gov/vuln/detail/CVE-2026-45066
  • symfony.com/cve-2026-45066

Code Behaviors & Features

Detect and mitigate CVE-2026-45066 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 6.1.0 before 6.4.40, all versions starting from 7.0.0 before 7.4.12, all versions starting from 8.0.0 before 8.0.12

Fixed versions

  • 6.4.40
  • 7.4.12
  • 8.0.12

Solution

Upgrade to versions 6.4.40, 7.4.12, 8.0.12 or above.

Weakness

  • CWE-184: Incomplete List of Disallowed Inputs
  • CWE-436: Interpretation Conflict

Source file

packagist/symfony/html-sanitizer/CVE-2026-45066.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:25 +0000.