CVE-2026-118517 · Package
NO FIX YET · SEE WHAT TO DO
The Symfony HtmlSanitizer UrlSanitizer parses some malformed URLs differently from browsers, so allowLinkHosts() and allowMediaHosts() checks are skipped for them. Untrusted hosts can end up referenced in sanitized HTML output.
first public Nov 4, 2026 · 1 source
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
Applications that use the Symfony HtmlSanitizer with a host allow-list (allowLinkHosts or allowMediaHosts) and also allow relative links or media. The default configuration is not affected, so applications that do not set a host allow-list can skip it.
Not affected if default-config, no-host-allow-list, relative-links-disabled
Who cares html-sanitizer, php, symfony
composer show symfony/html-sanitizer to see the installed version.allowLinkHosts( or allowMediaHosts( together with allowRelativeLinks(true) or allowRelativeMedias(true).6.4.50, 7.4.23, and 8.1.11 (and later in each line); 6.1.x is affected before 6.4.50, so move to the 6.4 line.The Symfony HtmlSanitizer component UrlSanitizer parses URLs differently from browsers, allowing the allowLinkHosts() and allowMediaHosts() checks to be bypassed for URLs without a well-formed authority, resulting in untrusted hosts being referenced in sanitized output in Symfony versions 6.1.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.
UrlSanitizer parses URLs with league/uri, which follows RFC 3986, while browsers follow the WHATWG URL standard. For URLs without a well-formed authority, such as http:evil.example, ///evil.example, or https://://evil.example/ the sanitizer finds no host, whereas browsers resolve them to evil.example. The guard added for CVE-2026-45066 missed the zero-slash form, and the host 0 was also skipped because PHP treats it as falsy.
This is exploitable when a host allow-list is combined with allowRelativeLinks(true) or allowRelativeMedias(true). The default configuration is not affected.
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
This page as .md · .json · CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.