CVE-2026-48998
JSON

5.3medium

guzzlehttp/psr7 has Host Confusion via Authority Reinterpretation

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.20% (higher than 10% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-34xg-wgjx-8xph

Description

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Versions prior to 2.10.2 contain improper Host header validation when parsing raw HTTP request messages and when deriving a server request URI from server variables. An attacker can provide a malformed Host header containing URI authority delimiters, such as `trusted.example@evil.example`. When the Host value is used to construct a URI, the malformed value can be reinterpreted as URI userinfo and host. This can cause the PSR-7 request URI host to differ from the original Host header value. Applications are affected if they parse attacker-controlled raw HTTP requests with `GuzzleHttp\Psr7\Message::parseRequest()` or the legacy 1.x `GuzzleHttp\Psr7\parse_request()` function, or if they build server requests from attacker-controlled server variables, then rely on the resulting URI host for routing, allow-list checks, or forwarding decisions. In affected forwarding or gateway scenarios, this may cause requests or credentials to be sent to an unintended host. The issue is patched in `2.10.2`. `1.x` is end-of-life and will not receive a patch. Some workarounds are available. Validate the `Host` header as `uri-host [ ":" port ]` before calling `Message::parseRequest()` or legacy `parse_request()` on untrusted HTTP request data, or before deriving routing and forwarding decisions from a parsed request URI. Reject Host values containing userinfo, path, query, or fragment delimiters.

Affected

Product or packageVersionsReported by
guzzle psr7< 2.10.2CVE List
guzzlehttp/psr7 (Packagist)before 2.10.2GitHub Advisory Database
guzzlephp psr-7before 2.10.2NVD

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Classification

CWE-20CWE-918

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Versions prior to 2.10.2 contain improper Host header validation when parsing raw HTTP request messages and when deriving a server request URI from server variables. An attacker can provide a malformed Host header containing URI authority delimiters, such as `trusted.example@evil.example`. When the Host value is used to construct a URI, the malformed value can be reinterpreted as URI userinfo and host. This can cause the PSR-7 request URI host to differ from the original Host header value. Applications are affected if they parse attacker-controlled raw HTTP requests with `GuzzleHttp\Psr7\Message::parseRequest()` or the legacy 1.x `GuzzleHttp\Psr7\parse_request()` function, or if they build server requests from attacker-controlled server variables, then rely on the resulting URI host for routing, allow-list checks, or forwarding decisions. In affected forwarding or gateway scenarios, this may cause requests or credentials to be sent to an unintended host. The issue is patched in `2.10.2`. `1.x` is end-of-life and will not receive a patch. Some workarounds are available. Validate the `Host` header as `uri-host [ ":" port ]` before calling `Message::parseRequest()` or legacy `parse_request()` on untrusted HTTP request data, or before deriving routing and forwarding decisions from a parsed request URI. Reject Host values containing userinfo, path, query, or fragment delimiters.

GitHub Advisory Database

Impact

guzzlehttp/psr7 improperly interpreted malformed Host header values when constructing request URIs from inbound request data. This issue concerns inbound request parsing and server request construction. It does not require serializing a PSR-7 request, and it is not part of the normal outbound request-sending path used by guzzlehttp/guzzle.

A vulnerable flow is:

  1. An attacker controls a raw HTTP request or server variable containing a Host value.
  2. The Host value contains URI authority delimiters, such as trusted.example@evil.example.
  3. guzzlehttp/psr7 uses that value to construct a URI.
  4. The URI parser treats the portion before @ as userinfo and the portion after @ as the URI host.
  5. The resulting PSR-7 request URI host differs from the original Host header value.

For example, Host: trusted.example@evil.example can result in a PSR-7 URI whose host is evil.example, while the original Host header value remains trusted.example@evil.example.

Applications are affected if they parse attacker-controlled raw HTTP requests with GuzzleHttp\Psr7\Message::parseRequest() or the legacy 1.x GuzzleHttp\Psr7\parse_request() function, or if they build server requests from attacker-controlled server variables with GuzzleHttp\Psr7\ServerRequest::fromGlobals() or GuzzleHttp\Psr7\ServerRequest::getUriFromGlobals(), and then rely on the resulting URI host for routing, allow-list checks, credential selection, or forwarding decisions. Applications using guzzlehttp/psr7 only through Guzzle's standard HTTP client APIs are not expected to be affected. In affected forwarding or gateway scenarios, this may cause requests or credentials to be sent to an unintended host.

Patches

The issue is patched in 2.10.2 and later. 1.x is end-of-life and will not receive a patch.

Workarounds

If you cannot upgrade immediately, validate Host values before passing untrusted request data to Message::parseRequest(), legacy 1.x parse_request(), ServerRequest::fromGlobals(), or ServerRequest::getUriFromGlobals().

Accept only uri-host [ ":" port ]. Reject values containing whitespace, control characters, userinfo (@), path (/ or \), query (?), fragment (#), malformed IP literals or bracket syntax, or invalid port syntax.

Do not validate Host by prefixing it with http:// and passing it to parse_url(), because that can reinterpret malformed values as URI userinfo and host.

References

NVD (es)

guzzlehttp/psr7 es una implementación de la biblioteca de mensajes HTTP PSR-7 en PHP. Las versiones anteriores a la 2.10.2 contienen una validación incorrecta del encabezado Host al analizar mensajes de solicitud HTTP sin procesar y al derivar una URI de solicitud del servidor a partir de variables del servidor. Un atacante puede proporcionar un encabezado Host malformado que contenga delimitadores de autoridad de URI, como ’trusted.example@evil.example’. Cuando el valor de Host se utiliza para construir una URI, el valor malformado puede ser reinterpretado como información de usuario y host de la URI. Esto puede hacer que el host de la URI de solicitud PSR-7 difiera del valor original del encabezado Host. Las aplicaciones se ven afectadas si analizan solicitudes HTTP sin procesar controladas por un atacante con ’GuzzleHttp\Psr7\Message::parseRequest()’ o la función heredada 1.x ’GuzzleHttp\Psr7\parse_request()’, o si construyen solicitudes de servidor a partir de variables de servidor controladas por un atacante, y luego dependen del host de la URI resultante para el enrutamiento, las comprobaciones de lista de permitidos o las decisiones de reenvío. En escenarios de reenvío o de pasarela afectados, esto puede hacer que las solicitudes o credenciales se envíen a un host no deseado. El problema está parcheado en ’2.10.2’. ’1.x’ ha llegado al fin de su vida útil y no recibirá un parche. Algunas soluciones alternativas están disponibles. Valide el encabezado ’Host’ como ’uri-host [ ’:’ puerto ]’ antes de llamar a ’Message::parseRequest()’ o a la función heredada ’parse_request()’ en datos de solicitud HTTP no confiables, o antes de derivar decisiones de enrutamiento y reenvío de una URI de solicitud analizada. Rechace los valores de Host que contengan delimitadores de información de usuario, ruta, consulta o fragmento.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-48998 changed 2026-06-11CVE Terms of Use
GitHub Advisory DatabaseGHSA-34xg-wgjx-8xph changed 2026-09-10CC-BY-4.0
NVDCVE-2026-48998 changed 2026-10-26Public domain