llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · guzzlehttp/psr7

GHSA-JWVC-HJ95-82HH

Host Confusion via Incomplete Bracketed Host Validation in guzzlehttp/psr7

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
4.8
Media
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versión2.13.4
Exposición4 dDesde la divulgación, 17 nov 2026, 11:27 a. m.
Detección1 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Sin drama: ventana de mantenimiento y listo.Para el próximo sprint, sin estrés.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
17 nov 26
18 nov 26
21 nov 26
17 nov 26
18 nov 26
19 nov 26
20 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-JWVC-HJ95-82HH divulgada · CVSS 4.8 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

In affected versions, `GuzzleHttp\Psr7\Uri` accepts a bracketed host that continues after its closing bracket, such as `[::1]:8080]`. `Uri::getHost()` returns that whole text and `Uri::getPort()` the URI's own port, while a transport that reads the authority itself, such as PHP's stream wrapper, takes the first `]` as the end of the host and connects to `::1` on port `8080`. The issue is fixed in `2.13.4`.

Details

Since `2.12.3`, the first release to check brackets at all, `Uri::assertValidHost()` requires a host that contains a bracket to begin with `[` and end with `]`, but not that the first `]` is the last. GHSA-c2w2-prh8-qm98 described that release as rejecting a host with an embedded port; this form embeds one after the bracketed literal and passed the check. `Uri::withHost()` and `Uri::fromParts()` accept it as given, and so does `Request` when it generates a `Host` header from another `UriInterface` implementation. A URI string carries it when the authority has userinfo or the URI is a network-path reference: `http://user@[::1]:8080]:80/` and `//[::1]:8080]:80/` both give the host `[::1]:8080]`, in every release before `2.13.4`. From `2.12.3` to `2.13.3` the parser also decodes a percent-encoded bracket after it has matched the host, so `http://[::1%5D:8080]/` gives the same host; that route was introduced by the fix for GHSA-c2w2-prh8-qm98.

PHP's stream transport reads `tcp://[::1]:8080]:80` as host `::1`, port `8080`, and its `http` wrapper does the same with the URI string. libcurl `7.52.1` also connects to the inner port; `7.61.1`, `7.64.0`, `7.74.0` and `8.14.1` reject the URL.

This is a summary; the patches are the authority. The issue is fixed in `2.13.4`, which rejects a host whose first `]` is not its last character: `Uri::withHost()` throws `InvalidArgumentException`, and parsing and `Uri::fromParts()` throw `MalformedUriException`. Bracketed hosts that end at their closing bracket stay accepted on the 2 line even when they do not enclose an IPv6 address, as GHSA-c2w2-prh8-qm98 documented: `[127.0.0.1]`, `[localhost]` and `[gggg::1]` are stored as written. A transport may read them its own way: PHP's stream transport connects to `127.0.0.1` and `localhost` for the first two. `guzzlehttp/psr7` 3 is not affected, because it already has stronger input validation, introduced as part of a breaking change: since `3.0.0`, `Uri` accepts a bracketed host only if it is an IPv6 or IPvFuture literal. Versions before `2.13.4` are affected; `1.x` is end-of-life and will not receive a patch.

Proof of concept

A vulnerable flow, reproduced over a real socket on `2.13.3`, is:

  1. An application builds a `Uri` from an untrusted URL and checks `getHost()` and `getPort()` before fetching: it refuses loopback and private addresses, for example, or allows only ports 80 and 443.
  2. The attacker supplies `http://user@[127.0.0.1]:6379]:80/`.
  3. `Uri::getHost()` returns `[127.0.0.1]:6379]` and `Uri::getPort()` returns `null`. The host is not an IP address, and the port appears to be the default.
  4. The application opens the URI with PHP's stream wrapper, as in `fopen((string) $uri, 'r')`.
  5. PHP connects to `127.0.0.1` on port `6379` and sends the request with `Host: [127.0.0.1]:6379]`.
Impact

An attacker who controls a URI, or a host passed to `Uri::withHost()`, can make an application decide on one host and port while the request goes to another, and so reach a destination that its check excluded. `guzzlehttp/psr7` opens no connection itself, so the outcome depends on the component that sends the request. `guzzlehttp/guzzle` 7 is affected through its stream handler, and `7.16.3` (GHSA-hpvq-6rrx-pc47) rejects these hosts in its handlers as well.

Exploitation requires the application to build a `Uri` from untrusted input, to rely on `getHost()` or `getPort()` for a security decision, and to send the request with a transport that takes the first `]` as the end of the host. Applications that only handle URIs they construct themselves, that compare the host with an exact allowlist, or whose transport rejects the URL are not affected.

If you cannot upgrade, reject any `Uri` whose `getHost()` contains a `]` anywhere but at its end before acting on it.

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

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
7.1/ 10Alto
Vector 7.1 (fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
guzzlehttp/psr7< 2.13.4
2.13.4
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistguzzlehttp/psr7
Corregida 2.13.4 — —
Versiones corregidas2.13.4
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/guzzle/psr7/security/advisories/GHSA-jwvc-hj95-82hh

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