llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · symfony/html-sanitizer

GHSA-C76G-9C4C-GXRW

HtmlSanitizer allowLinkHosts() / allowMediaHosts() Bypass via URLs Without a Well-Formed Authority: Incomplete Fix for CVE-2026-45066

Parche disponible
Descargar PNG JSON
CVSS 4.0
2.3
Baja
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 Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche3 versiones6.4.50 · 7.4.23 · 8.1.11
Exposición16 dDesde la divulgación, 4 nov 2026, 6:43 a. m.
Detección16 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada +1
4 nov 26
5 nov 26
20 nov 26
4 nov 26
8 nov 26
12 nov 26
16 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-C76G-9C4C-GXRW divulgada · CVSS 2.3 (GitHub)
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Description

`UrlSanitizer` parses URLs with `league/uri`, which follows RFC 3986. For a special scheme written with no authority slashes, such as `http:evil.example`, RFC 3986 yields scheme `http`, host `null` and path `evil.example`. The sanitizer then skips the host allow-list check because the host is null, and with `allowRelativeLinks(true)` it also waives the rejection of hostless URLs, so the URL is kept. Browsers parse the same string per the WHATWG URL standard. There, `//` is optional when the scheme differs from the scheme of the page. The authority is then `evil.example`, and navigation goes to `http://evil.example/`. With the scheme of the page, as `https:evil.example` on an https page, browsers read a relative path instead. So on an https site, the attacker uses `http:`.

The guard added for CVE-2026-45066 rejects the one-slash and three-slash spellings but not the zero-slash form:

~^(?:https?|ftp|wss?):(/[^/]|///)~i

Proof of concept, with a configuration that allows one host plus relative links, a natural content-management setup:

$c = (new HtmlSanitizerConfig())->allowSafeElements()
    ->allowLinkHosts(['trusted.example'])->allowRelativeLinks(true);

(new HtmlSanitizer($c))->sanitize('<a href="https://evil.example/">x</a>');    // <a>x</a>, correct
(new HtmlSanitizer($c))->sanitize('<a href="http:evil.example/login">x</a>');  // unchanged, bypass

Two more spellings of the same disagreement were found while fixing. A scheme-relative URL with three or more slashes, `///evil.example`, is a path for RFC 3986 and the authority `evil.example` for browsers. An empty authority, `https://://evil.example/`, is an empty host followed by the path `//evil.example/` for RFC 3986, so the host allow-list was skipped, and rebuilding the URL produced `https:////evil.example/`, which browsers read as the authority `evil.example`. The media policy is affected the same way under `allowRelativeMedias(true)`.

Every form disappears with `allowRelativeLinks(false)`, so the default configuration is not affected. The severity is rated low on that basis: the bypass requires the opt-in combination of a host allow-list and relative URLs.

Resolution

The guard now requires the special schemes `http`, `https`, `ftp`, `ws` and `wss` to be followed by exactly `//`, which closes the zero-, one- and three-slash spellings in a single check, and rejects scheme-relative URLs that start with three or more slashes. After parsing, a URL whose authority is present but empty is rejected as well.

One behaviour change is worth noting for reviewers: a bare `https://`, and any URL with an empty authority, is now dropped where it previously round-tripped under `allowRelativeLinks(true)`.

The host allow-list is now also applied to the host `0`, which the sanitizer treated as a missing host (PHP considers the string falsy) while browsers resolve it to `0.0.0.0`: under `allowRelativeLinks(true)` such a URL was kept without being checked against the allowed hosts.

The patches for this issue are available here https://github.com/symfony/symfony/commit/f2f47d2eef6c2552c6c5c24953caa94f7901cb43 for branch 6.4 (and forward-ported to 7.4, 8.1 and 8.2).

Credits

We would like to thank Ilia Alshanetsky https://github.com/iliaal for reporting the issue.

We would also like to thank Bruno Dias https://github.com/cx-bruno-dias and Catarina Amorim https://github.com/cx-catarina-amorim from Checkmarx for their help getting a CVE assigned.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 4.0

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
Requisitos de ataqueAT:P
NingunoPresentes
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:P
NingunaPasivaActiva
Confid. (sistema)VC:N
AltoBajoNinguno
Integridad (sistema)VI:L
AltoBajoNinguno
Disponib. (sistema)VA:N
AltoBajoNinguno
Confid. (posterior)SC:N
AltoBajoNinguno
Integridad (posterior)SI:N
AltoBajoNinguno
Disponib. (posterior)SA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida
symfony/html-sanitizer · symfony/symfony≥ 6.1 < 6.4.50
symfony/html-sanitizer · symfony/symfony≥ 7 < 7.4.23
symfony/html-sanitizer · symfony/symfony≥ 8 < 8.1.11
6.1
6.4.50
7
7.4.23
8
8.1.11
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistsymfony/html-sanitizer
Corregida 6.4.50, 7.4.23, 8.1.11 — —
Packagistsymfony/symfony
Corregida 6.4.50, 7.4.23, 8.1.11 — —
Versiones corregidas6.4.507.4.238.1.11
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/symfony/symfony/security/advisories/GHSA-c76g-9c4c-gxrw

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.