GHSA-2g6w-c7gx-fxj8: 
PHP Análise e mitigação de vulnerabilidades

Summary

In affected versions, the client can parse a URI string twice: as given, and again from the string form of the URI it built. When another PSR-7 implementation supplies that URI, through the uri_factory option or a base_uri object, it can hold a host that is not a valid URI host, and the second parse can then read another host or port. The request is sent there. The issue is fixed in 8.5.5.

Details

The second parse was added in 8.0.0 with the uri_factory option. The client parses a URI string with the configured factory, resolves it against any base_uri, converts its host when idn_conversion is enabled, and adds a missing scheme; when that produces a new URI object, it hands the object's string form back to the factory. An invalid host gets into that object in two ways. With idn_conversion set to true, or to an IDNA_* bitmask without IDNA_USE_STD3_RULES, the conversion maps some characters to URI delimiters, such as @ to @, / to / and : to :, so http://evil.example/.good.example/ is sent to evil.example. Without idn_conversion, a library built on PHP's parse_url() reads //127.0.0.1:6379:80/x as the host 127.0.0.1:6379 and the port 80, and prints it without the default port, so port 6379 is read the second time; this needs a string without a scheme, or a client with a base_uri. GuzzleHttp\Psr7\Uri refuses both hosts, but the URIs of Nyholm, Laminas Diactoros, Slim and HttpSoft accept them, from the uri_factory or as a base_uri object with the default factory. The issue is fixed in 8.5.5, which throws an InvalidArgumentException when idn_conversion produces an invalid host, and before parsing a URI again when its host is invalid. One case stays open on 8.5.5: a host that converts as a whole to another valid host is still converted, so fullwidth digits can become an IPv4 address, and a policy belongs on the converted host. A request URI given as an object, or a redirect target that names a host, is not parsed again, so an invalid host stays in the URI and the request is rejected. Guzzle 7 is not affected for the same reason: it never parses a URI twice. Versions 8.0.0 through 8.5.4 are affected, with or without the fix for GHSA-v5mv-p594-2x33, which 8.0.0 alone lacks.

Proof of concept

A vulnerable flow, reproduced over a real socket on 8.5.4 with each built-in handler and the nyholm/psr7 factory, is:

  1. An application creates its client with a third-party PSR-17 factory as uri_factory and with idn_conversion enabled.
  2. It checks an untrusted URL before fetching it, and allows only hosts that end in .trusted.example.
  3. The attacker supplies http://127.0.0.1/.trusted.example/x.
  4. The factory reads the host 127.0.0.1/.trusted.example, which passes the check. Converting the host first gives 127.0.0.1/.trusted.example, which passes too.
  5. The client sends GET /.trusted.example/x to 127.0.0.1, with Host: 127.0.0.1. With idn_conversion disabled, //127.0.0.1:6379:80/x reached port 6379 in the same setup, past a check that allows only ports 80 and 443.

Impact

An attacker who influences a fetched URI can reach a host or a port that the application's own check excluded, and read whatever the application exposes of the response. Through the conversion this defeats denylists, IP-literal checks, port restrictions, allowlists that match a suffix or a pattern, and a check made on the converted host. Without it, only denylists, IP-literal checks and port restrictions are exposed, since the host that the application reads is itself malformed. Exploitation requires the application to use another PSR-7 implementation whose URIs accept such a host, as its uri_factory or for a base_uri object, to build a request URI string or that base_uri from untrusted input, and to make a host or port decision before handing it over. Applications that leave uri_factory unset and give base_uri as a string, or that only fetch URIs they construct themselves, are not affected, and an exact allowlist of hosts fails closed. If you cannot upgrade, leave uri_factory unset and give base_uri as a string, or pass request URIs as objects, which are not parsed again.


Origem: NVD

Relacionado PHP Vulnerabilidades:

CVE ID

Gravidade

Pontuação

Tecnologias

Nome do componente

Exploit CISA KEV

Tem correção

Data de publicação

CVE-2026-104883HIGH7.2
  • PHP logoPHP
  • contao/core-bundle
NãoSimNov 20, 2026
GHSA-vw9g-2c4c-g767MEDIUM6.8
  • PHP logoPHP
  • livewire/livewire
NãoSimNov 21, 2026
CVE-2026-104882MEDIUM6.5
  • PHP logoPHP
  • cpe:2.3:a:contao:contao
NãoSimNov 20, 2026
GHSA-2g6w-c7gx-fxj8MEDIUM5.4
  • PHP logoPHP
  • guzzlehttp/guzzle
NãoSimNov 21, 2026
CVE-2026-104884MEDIUM5.4
  • PHP logoPHP
  • composer://contao/contao
NãoSimNov 20, 2026

Avaliação Gratuita de Vulnerabilidades

Avalie a sua postura de segurança na nuvem

Avalie suas práticas de segurança em nuvem em 9 domínios de segurança para avaliar seu nível de risco e identificar lacunas em suas defesas.

Avaliação de solicitação

Recursos adicionais da Wiz

Marque uma demonstração personalizada

Pronto para ver a Wiz em ação?

"A melhor experiência do usuário que eu já vi, fornece visibilidade total para cargas de trabalho na nuvem."
David EstlickCISO
"A Wiz fornece um único painel de vidro para ver o que está acontecendo em nossos ambientes de nuvem."
Adam FletcherDiretor de Segurança
"Sabemos que se a Wiz identifica algo como crítico, na verdade é."
Greg PoniatowskiChefe de Gerenciamento de Ameaças e Vulnerabilidades