# CVE-2026-118517: Symfony HtmlSanitizer UrlSanitizer host allowlist bypass

Source: https://junglewise.ai/threats/cve-2026-118517-the-symfony-htmlsanitizer-component-urlsanitizer-parses-urls  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-05. Updated: 2026-11-05  
License: CC BY 4.0 with a link back

CVE-2026-118517 · Severity: medium · CVSS 4.3 · Published 2026-11-05

Symfony's HtmlSanitizer component fails to properly validate domain names in URLs when allowLinkHosts() or allowMediaHosts() are combined with relative URL permissions, potentially allowing untrusted domains to be embedded in sanitized HTML. An attacker can craft malformed URLs that bypass the host allowlist, enabling injection of content from arbitrary domains into pages that should only allow whitelisted hosts.

Technologies: [Symfony HtmlSanitizer](https://junglewise.ai/threats/technologies/htmlsanitizer). Vendors: [Symfony](https://junglewise.ai/threats/vendors/symfony).

## Quick answers

**Is CVE-2026-118517 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-118517 being exploited in the wild.

**How severe is CVE-2026-118517?** Medium severity, with a CVSS score of 4.3, published 5 November 2026.

**Which products and versions are affected?** Symfony HtmlSanitizer 6.1.x before 6.4.50, 7.x before 7.4.23, 8.x before 8.1.11.

**Is there a fix for CVE-2026-118517?** Yes: fixed in Symfony 6.4.50, 7.4.23, 8.1.11. Until then: Do not combine allowLinkHosts() or allowMediaHosts() with allowRelativeLinks(true) or allowRelativeMedias(true) until upgrading; use the default configuration which is not affected. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-118517 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-118517?** Check whether you run Symfony HtmlSanitizer at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in Symfony 6.4.50, 7.4.23, 8.1.11

Do not combine allowLinkHosts() or allowMediaHosts() with allowRelativeLinks(true) or allowRelativeMedias(true) until upgrading; use the default configuration which is not affected.

## Technical details

The UrlSanitizer uses the league/uri library which parses URLs per RFC 3986, while browsers follow the WHATWG URL standard. For malformed URLs without a well-formed authority (e.g., "http:evil.example", "///evil.example", "https://://evil.example/"), the sanitizer fails to extract a host while browsers resolve them correctly, bypassing the allowlist when relative URLs are enabled. Additionally, the host "0" was treated as falsy by PHP and skipped during validation.

## Affected products

- Symfony HtmlSanitizer 6.1.x before 6.4.50, 7.x before 7.4.23, 8.x before 8.1.11

## Timeline

- 2026-11-05: disclosed

## References

- [https://packagist.org/packages/symfony/http-client](https://packagist.org/packages/symfony/http-client)
- [https://github.com/symfony/symfony/commit/f2f47d2eef6c2552c6c5c24953caa94f7901cb43](https://github.com/symfony/symfony/commit/f2f47d2eef6c2552c6c5c24953caa94f7901cb43)

## Related threats

- [Symfony HtmlSanitizer media URL policy bypass in srcset attributes](https://junglewise.ai/threats/cve-2026-121949-the-symfony-htmlsanitizer-component-does-not-apply-the-media-url)
- [Symfony HtmlSanitizer meta refresh URL sanitization bypass](https://junglewise.ai/threats/cve-2026-121373-the-symfony-htmlsanitizer-component)
- [Symfony HtmlSanitizer XSS via incomplete URL attribute sanitization](https://junglewise.ai/threats/cve-2026-48761-symfony-htmlsanitizer-xss-via-incomplete-url-attribute)
- [Symfony HtmlSanitizer visual spoofing via percent-encoded BiDi characters](https://junglewise.ai/threats/cve-2026-48760-symfony-htmlsanitizer-visual-spoofing-via-percent-encoded-bidi)
- [Symfony HtmlSanitizer XSS via incomplete URL attribute list](https://junglewise.ai/threats/cve-2026-45753-symfony-htmlsanitizer-xss-via-incomplete-url-attribute-list)
