Guzzle, the HTTP client that sits underneath a huge share of PHP applications (Laravel’s HTTP client, many SDKs, Drupal and more), shipped 7.17.1 and 8.6.1 on 1 December 2026 to fix advisory GHSA-fhrc-5gm6-wm85. In some setups, the bug sends your proxy username and password to the website you’re requesting.

GitHub rates the advisory low severity, and it only applies in a specific configuration. But if your app makes HTTPS calls through an authenticated corporate or egress proxy, read on. This guide explains the bug in plain terms, shows how to tell whether you’re affected, and walks through upgrading, testing and mitigating.

Affected versions

Package Vulnerable Fixed
guzzlehttp/guzzle 7.x >=7.3.0, <7.17.1 7.17.1
guzzlehttp/guzzle 8.x >=8.0.0, <8.6.1 8.6.1

Guzzle also released 7.17.2 the same day with two unrelated bug fixes (no more replaying Expect: 100-continue requests after a 417 response, and safer Set-Cookie parsing). Going straight to the latest 7.x picks up both.

What actually goes wrong

Guzzle has two main ways to send a request: the cURL handlers (the default when the cURL extension is installed) and the StreamHandler, which uses PHP’s built-in http:// stream wrapper.

When the StreamHandler sends an https request through an HTTP proxy with credentials, it builds a Proxy-Authorization header from the proxy URL. PHP is supposed to put that header on the CONNECT request to the proxy and remove it from the tunnelled request to the real site.

According to the advisory, PHP only removes the line if it’s the first place the text proxy-authorization: appears in the header block. Guzzle used to append its generated line after your own request headers. So if any earlier header contained that text, PHP removed nothing and the credentials went to the origin server. That covers a header name like X-Proxy-Authorization, or even a cookie value.

The advisory describes two realistic ways this happens:

  1. No attacker needed: your app sends a header such as X-Proxy-Authorization. Every origin you call through the proxy then receives your proxy credentials.
  2. Attacker-controlled site: with the cookies option enabled, a site you fetch can set a cookie like pref=proxy-authorization:1 and redirect. The next request carries that cookie before the generated line, and the site receives Proxy-Authorization: Basic ....

The fix in 7.17.1 and 8.6.1 writes the generated line before the request headers, so PHP always finds and removes it.

Are you affected? A quick checklist

You’re only exposed if all of these are true:

  • You send https requests through an HTTP proxy that needs credentials, whether set with the proxy option or with environment variables like HTTPS_PROXY.
  • Those requests go through the StreamHandler, because:
  • the cURL extension isn’t installed, or
  • you configured StreamHandler explicitly, or
  • you pass the stream => true request option.
  • Some request header line contains the text proxy-authorization:. That can come from a custom header, from cookies (with cookies enabled), or via redirects with allow_redirects referer enabled.

Apps that use the cURL handlers, use no proxy credentials, or only send plain http requests through the proxy are not affected, according to the advisory.

Find your installed version

composer show guzzlehttp/guzzle | grep versions
composer why guzzlehttp/guzzle     # which packages pull it in
composer audit                     # lists known advisories for your lock file

Check whether cURL is available

php -m | grep -i curl

If curl is missing on a production image (slim Docker images are a common culprit), Guzzle falls back to the StreamHandler for everything.

Search your code for the risky patterns

grep -rn --include=*.php -E "StreamHandler|'stream'\s*=>\s*true|Proxy-Authorization" app/ src/ config/

Upgrade

# Guzzle 7
composer require guzzlehttp/guzzle:^7.17.1 --update-with-dependencies

# Guzzle 8
composer require guzzlehttp/guzzle:^8.6.1 --update-with-dependencies

If Guzzle only arrives as a dependency (for example through laravel/framework or a cloud SDK), update it directly:

composer update guzzlehttp/guzzle --with-dependencies
composer show guzzlehttp/guzzle | grep versions

Commit the updated composer.lock and redeploy. Laravel’s Http facade is built on Guzzle, so upgrading the package covers it too.

A safer configuration pattern

Even after upgrading, it makes sense to keep proxy credentials on the cURL path where you can. Here’s an explicit client that uses cURL and reads the proxy from configuration:

<?php

use GuzzleHttp\Client;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;

$stack = HandlerStack::create(new CurlHandler());

$client = new Client([
    'handler' => $stack,
    'proxy'   => [
        'https' => getenv('EGRESS_PROXY_URL'), // e.g. http://user:[email protected]:3128
    ],
    'timeout' => 10,
]);

$response = $client->get('https://api.example.com/health');
echo $response->getStatusCode(), PHP_EOL;

Also avoid sending headers whose names contain Proxy-Authorization to origins. If a legacy upstream really wants a header like X-Proxy-Authorization, rename it or send it only to hosts you trust.

Mitigation if you can’t upgrade today

The advisory’s workaround: send requests that use an authenticated proxy through the cURL handlers, without the stream option. In practice:

  1. Install and enable the cURL extension (ext-curl) in every runtime image.
  2. Remove 'stream' => true from requests that go through the proxy, or give streaming downloads their own client with no proxy credentials.
  3. Don’t force StreamHandler in handler stacks used with proxies.

One edge case stays open on 7.17.1: if you pass a raw stream_context http.header value, it replaces Guzzle’s generated header block, so a Proxy-Authorization line in it stays wherever you put it. Guzzle 8 rejects that option. If you build stream contexts by hand on 7.x, review them.

Rotate the credentials if you were exposed

If your setup matched the checklist, assume the proxy credentials may have reached third-party servers:

  • Rotate the proxy username and password.
  • Check proxy logs for use from unexpected source IPs.
  • Prefer per-service proxy credentials so one leak doesn’t expose everything.

Add a guard test

A small test can stop a future dependency downgrade or a slim Docker image from quietly reopening the problem. Composer’s runtime API reports the installed version:

use Composer\InstalledVersions;

it('runs a patched Guzzle with cURL available', function () {
    expect(extension_loaded('curl'))->toBeTrue();

    $version = ltrim(InstalledVersions::getVersion('guzzlehttp/guzzle'), 'v');
    $minimum = str_starts_with($version, '8.') ? '8.6.1' : '7.17.1';

    expect(version_compare($version, $minimum, '>='))->toBeTrue();
});

Run it in the same container image you deploy, so it checks the extensions that are really there in production.

Takeaway

This is a narrow bug with a simple fix: upgrade to Guzzle 7.17.1+ or 8.6.1+, keep ext-curl installed, and don’t route authenticated-proxy HTTPS traffic through the StreamHandler. If you’ve been running slim images without cURL behind a corporate proxy, rotate those proxy credentials too.

Sources: GHSA-fhrc-5gm6-wm85, Guzzle 7.17.1 release, Guzzle 8.6.1 release, Guzzle changelog.