CVE-2026-59882: Guzzle PSR-7 host confusion via weak URI host validation

CVE-2026-59882 · Severity: medium · CVSS 4.2 · Published 2026-07-08

A vulnerability in the Guzzle PSR-7 library, a common tool for handling web requests in PHP, could allow attackers to bypass security filters. By providing specially crafted web addresses (URIs), an attacker can trick the software into connecting to a different server than the one it thinks it is communicating with. This could lead to unauthorized data access, bypass of security blocklists, or internal network scanning.

Technologies: guzzlehttp/psr7 (Packagist). Vendors: Packagist.

Quick answers

Is CVE-2026-59882 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-59882 being exploited in the wild.
How severe is CVE-2026-59882?
Medium severity, with a CVSS score of 4.2, published 8 July 2026.
Which products and versions are affected?
guzzlehttp/psr7 (Packagist) < 2.12.3, ECOSYSTEM:introduced=0,fixed=2.12.3.
Is there a fix for CVE-2026-59882?
Yes. guzzlehttp/psr7 (Packagist): upgrade to 2.12.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-59882 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-59882?
Check whether you run guzzlehttp/psr7 (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • guzzlehttp/psr7 (Packagist): upgrade to 2.12.3 or later
    composer require guzzlehttp/psr7:^2.12.3

Technical details

Guzzle PSR-7 fails to properly validate URI host components, accepting malformed hosts containing authority delimiters (/, ?, #, @, or \), embedded ports, or unbalanced IPv6 brackets. The `Uri::assertValidHost()` method only rejected control characters, causing `Uri::getHost()` to return values that differ from the actual connection target used by downstream HTTP components. An attacker can exploit this interpretation conflict to bypass host-based security checks, such as SSRF guards, cookie scoping, or proxy-bypass lists. The issue is resolved in version 2.12.3 by enforcing stricter validation during URI parsing and modification.

Affected products

  • guzzlehttp psr7 < 2.12.3

Identifiers

  • CVE-2026-59882
  • GHSA-c2w2-prh8-qm98

Timeline

  • 2026-06-23: disclosed
  • 2026-06-23: patched: Version 2.12.3 released
  • 2026-07-08: kev added: NVD publication date
  • 2026-07-21: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.