CVE-2026-69246: Guzzle: Noncanonical host can bypass host-based checks
Impact
In affected versions, Guzzle gives a transport the request URI as text and supplies the Host header separately. The cURL handlers set CURLOPTURL to the URI exactly as written and push that Host into CURLOPTHTTPHEADER; StreamHandler does the same through fopen(). libcurl then parses the authority itself, percent-decoding it and, on an IDN-capable build, applying IDNA mapping, and uses the result to resolve, connect, name the TLS peer and address a proxy CONNECT, while the supplied Host suppresses the aligned one it would have generated. In http://127.0.0.%31/ the URI host is one filtervar() rejects as an IP literal, yet libcurl decodes it to 127.0.0.1 and reaches loopback with no DNS lookup while the server receives Host: 127.0.0.%31.
An attacker who influences a fetched URI can therefore reach a host the application's checks excluded and read whatever it exposes of the response. The same divergence moves Guzzle's own decisions onto a spelling the transport does not use: noproxy selects proxy routing from the literal host, and RedirectMiddleware decides from it whether to strip Authorization and Cookie. The cookie middleware extracts Set-Cookie against the URI Guzzle produced, not the authority contacted, so for a raw divergent URI the cookie is stored under the URI host as written. Where Guzzle rewrote that URI but left a divergent Host, or where the caller supplied one, the cookie is stored under the canonical name and replayed by ordinary later requests to it. With a third-party UriInterface, a host of blocked.example.com@127.0.0.1 reaches 127.0.0.1 through all three handlers and generates Authorization: Basic from userinfo the application never wrote.
Exploitation requires the application to build a request URI from untrusted input and to make a host decision before handing it to Guzzle. Applications that only fetch URIs they construct themselves are not affected, and an exact allowlist of canonical names ordinarily fails closed; the exposure is to denylists, private-range and IP-literal checks, and any check that treats an unresolvable name as safe. The raw Unicode class needs an IDNA transformation somewhere: either a libcurl built with IDN support or Guzzle's own idnconversion, off by default on both branches, which rewrites the URI in Client::buildUri() before a handler sees it and leaves a prebuilt request's explicit Host as written, while a request the client builds derives that header from the rewritten URI and produces no divergence. Noncanonical numeric spellings such as 127.1, 2130706433, 0x7f000001 and 0177.0.0.1 remain accepted after the patch and reach whatever the transport reads them as, loopback or a routable public host, and the cURL and stream handlers can differ, so a check comparing a host against an address as text stays bypassable. Guzzle does not offer SSRF protection, and neither cache poisoning nor cross-tenant compromise was established.
Patches
This is a summary; the patches are the authority. The issue is fixed in 7.15.2 and 8.0.1, which validate the request host in all three built-in handlers before any network I/O. A URI host is rejected for a byte outside 0x21 to 0x7E, a percent escape, a URI authority delimiter, unbalanced brackets, or numeric-looking parts followed by a trailing dot. That last rule is deliberately conservative and also refuses out-of-range forms libcurl keeps as names, such as 256.0.0.1.. An explicit Host header must be printable ASCII, and on 7.15.2 free of percent escapes. The client also regenerates a derived Host when it rewrites the request URI. Versions before 7.15.2 and version 8.0.0 are affected.
Workarounds
If you cannot upgrade, constrain the host yourself before handing a URI to Guzzle, and constrain any explicit Host header separately, on every redirect hop. The URI rule assumes $uri is a validated GuzzleHttp\Psr7\Uri, so re-parse a third-party UriInterface with new Uri((string) $uri) first.
php $host = $uri->getHost();
if ( pregmatch('/\A[\x21-\x7E]\z/D', $host) !== 1 || strpbrk($host, '%@/?#\\') !== false || substr($host, -1) === '.' ) { throw new RuntimeException('Refusing to fetch this URI host.'); }
if ( pregmatch('/\A[\x21-\x7E]\z/D', $hostHeader) !== 1 || strpos($hostHeader, '%') !== false ) { throw new RuntimeException('Refusing to send this Host header.'); }
It differs from the patch in both directions: it refuses example.com., which the patch accepts, and it does not canonicalize 127.1 or 0x7f000001. Reparsing the URI separates a valid port from the host and rejects malformed bracket forms, so the snippet checks the host component alone. idnconversion => true is not an access control, since IDNA maps 127。0。0。1 onto 127.0.0.1 and direct handler use bypasses it, and Uri::getHost() is not an SSRF boundary: it is the host as written, not the host a transport connects to. Where the destination matters, resolve the host and check the addresses, and use a separate cookie jar for untrusted origins.
Other sources
Guzzle is an extensible PHP HTTP client. Prior to 7.15.2 and 8.0.1, Guzzle gives a transport the request URI as text and supplies the Host header separately. The cURL handlers set CURLOPTURL to the URI exactly as written and push that Host into CURLOPTHTTPHEADER; StreamHandler does the same through fopen(). libcurl then parses the authority itself, percent-decoding it and, on an IDN-capable build, applying IDNA mapping, and uses the result to resolve, connect, name the TLS peer and address a proxy CONNECT, while the supplied Host suppresses the aligned one libcurl would have generated. For a URI host written as 127.0.0.%31, filtervar() rejects the host as an IP literal, yet libcurl decodes it to 127.0.0.1 and reaches loopback with no DNS lookup while the server receives Host: 127.0.0.%31. An attacker who influences a fetched URI can therefore reach a host the application's checks excluded and read whatever the host exposes of the response. The same divergence moves Guzzle's own decisions onto a spelling the transport does not use: noproxy selects proxy routing from the literal host, and RedirectMiddleware decides from it whether to strip Authorization and Cookie. Exploitation requires the application to build a request URI from untrusted input and to make a host decision before handing it to Guzzle. This issue is fixed in versions 7.15.2 and 8.0.1.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/guzzlehttp/guzzleto a version that resolves this vulnerability.Fixed in 8.0.1 - Upgrade
Upgrade
composer/guzzlehttp/guzzleto a version that resolves this vulnerability.Fixed in 7.15.2 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.15.2 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.0.1 - Configuration
If you cannot upgrade, validate the request URI host you will pass to Guzzle using the rules shown in the snippet (reject non-printable ASCII/percent escapes/URI authority delimiter characters and trailing dot) before handing the URI to Guzzle.
SSRF pre-validation before handing URI to Guzzle URI host character allowlist / filtering = Use regex preg_match('/\A[\x21-\x7E]*\z/D', $host) and reject if != 1; also reject if strpbrk($host, '%@/?#\\') !== false; also reject if substr($host, -1) === '.' - Configuration
If you cannot upgrade, constrain any explicit Host header you will send separately from the URI using the rules shown in the snippet (reject non-printable ASCII and any percent escapes) before handing the request to Guzzle.
SSRF pre-validation for explicit Host header Host header printability and percent-escape prohibition = Use regex preg_match('/\A[\x21-\x7E]*\z/D', $hostHeader) and reject if != 1; also reject if strpos($hostHeader, '%') !== false - Configuration
For a URI host coming from a third-party UriInterface, re-parse it first with `new Uri((string) $uri)` so Guzzle performs host-component validation on the parsed value (as described: re-parsing separates host from port and rejects malformed bracket forms).
URI handling with third-party UriInterface Re-parse URI into GuzzleHttp\Psr7\Uri = new Uri((string) $uri) - Compensating control
If you cannot upgrade, constrain the host yourself before handing a URI to Guzzle, and constrain any explicit Host header separately, on every redirect hop.
- Compensating control
When the destination matters, resolve the host and check the addresses (not just the textual host), and use a separate cookie jar for untrusted origins.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-69246?
The severity of CVE-2026-69246 is rated high with a score of 7.2.
What is the impact of CVE-2026-69246?
CVE-2026-69246 can allow an attacker to bypass host-based checks due to noncanonical host handling in Guzzle.
How do I fix CVE-2026-69246?
To fix CVE-2026-69246, upgrade to the latest patched version of Guzzle.
What software is affected by CVE-2026-69246?
CVE-2026-69246 affects the Guzzle HTTP client in the Composer package.
How can CVE-2026-69246 lead to SSRF attacks?
CVE-2026-69246 can lead to SSRF (Server-Side Request Forgery) attacks due to improper handling of the Host header.