Packagist
CVE-2026-59882
guzzlehttp/psr7: Host Confusion via Weak URI Host Validation
- Severity
- Medium 4.2
- Published
- 21 Jul 2026
- Last changed
- 21 Jul 2026
- Added to UpHeron
- 23 Oct 2026
- Fixed in
- 2.12.3
- Exploit chance
- 0.3% in the next 30 daysHigher than 25% of CVEs. EPSS by FIRST, 19 Nov 2026
- Attack
- Over the network · Only under certain conditions · No login needed · Needs someone to click or open something
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N- Also known as
- GHSA-c2w2-prh8-qm98
- Sources
- OSV.dev and GitHub
Description
guzzlehttp/psr7 did not reject URI host components containing authority delimiters (/, ?, #, @, or ), an embedded port such as host:8080, or IPv6 brackets that do not frame the host (such as [::1 or ::1]). Uri::assertValidHost() rejected only control characters, so these malformed hosts were accepted both when parsing a URI string — including through new Uri(), an absolute-form request target passed to Message::parseRequest(), and the synthetic SERVER_NAME or SERVER_ADDR fallback used by ServerRequest::fromGlobals() — and when setting a host with Uri::withHost(). Because the stored host was not validated, Uri::getHost() could return a value that does not agree with the URI's authority or with the host that is actually used on the wire. For example, Uri::withHost('[email protected]') is accepted, and new Uri('http://[gggg::1]/') produces a getHost() of '[gggg:' while getAuthority() returns '[gggg::1'.
Workarounds
If you cannot upgrade immediately, validate and normalize host values before you build or modify a Uri from untrusted input, and do not treat Uri::getHost() as a trust boundary for a host you have not independently checked. Before passing a host to Uri, reject any value that contains /, ?, #, @, or \, that contains a colon outside a bracketed IPv6 literal, or that has unbalanced brackets.
Affected software
| Software | Affected versions |
|---|---|
guzzlehttp/psr7Packagist · osv:Packagist:guzzlehttp/psr7 |
|
About guzzlehttp/psr7
- Monthly downloads (Packagist)
- 37,409,142Packagist, 17 Nov 2026
- Total downloads (Packagist)
- 1,196,134,859Packagist, 17 Nov 2026
Vulnerabilities in guzzlehttp/psr7
- In our list
- 4
- Published in the last 12 months
- 4
- Critical, last 12 months
- 0
- High, last 12 months
- 0
- Known exploited
- 0
- CVE-2026-55766guzzlehttp/psr7: CRLF Injection in HTTP Start-Line SerializationMedium 4.8 19 Jun 2026
- CVE-2026-48998guzzlehttp/psr7 has Host Confusion via Authority ReinterpretationMedium 5.3 11 Jun 2026
- CVE-2026-49214guzzlehttp/psr7 has CRLF Injection via URI Host ComponentMedium 5.3 11 Jun 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-59882
- GitHub Advisory Database https://github.com/advisories/GHSA-c2w2-prh8-qm98