Every CVE Search/ Get API key

CVE-2026-59882

guzzlehttp/psr7: Host Confusion via Weak URI Host Validation

4.2 MediumFix available

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.3, Uri::assertValidHost() does not reject URI host components containing authority delimiters, embedded ports, or malformed IPv6 brackets, allowing Uri::getHost() to disagree with the URI authority used for security or routing decisions. This issue is fixed in version 2.12.3.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
Low
Integrity
Low
Availability
None

Exploit likelihood

0.32%Up 0.1 points since Jul 9, 2026
90%50%10%1%

What each source reports

CVE List Score used 4.2

guzzlehttp/psr7: Host Confusion via Weak URI Host Validation

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.3, Uri::assertValidHost() does not reject URI host components containing authority delimiters, embedded ports, or malformed IPv6 brackets, allowing Uri::getHost() to disagree with the URI authority used for security or routing decisions. This issue is fixed in version 2.12.3.

Record
CVE-2026-59882
CVSS 3.1
4.2 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-436
Updated
2026-11-02
EUVDEUVD-2026-42319 4.2

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.3, Uri::assertValidHost() does not reject URI host components containing authority delimiters, embedded ports, or malformed IPv6 brackets, allowing Uri::getHost() to disagree with the URI authority used for security or routing decisions. This issue is fixed in version 2.12.3.

Record
EUVD-2026-42319
CVSS 3.1
4.2 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-c2w2-prh8-qm98 4.2

guzzlehttp/psr7: Host Confusion via Weak URI Host Validation

Impact

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'.

You are affected if your application builds a Uri or calls Uri::withHost() with host data that is wholly or partly attacker-controlled and then relies on Uri::getHost() for a security or routing decision, such as host allowlisting or denylisting, an SSRF guard, cookie scoping, or proxy-bypass selection. You are also affected if you parse, forward, proxy, or re-serialize URIs that come from untrusted raw HTTP messages or from synthetic $_SERVER values. Because getHost() can then disagree with the real connection target, the concrete impact depends on how your application and any downstream HTTP/1.x component use the URI, and may include host-based access-control bypass, server-side request forgery, routing to an unintended host, or Host header confusion. You are not affected if every host you place into a Uri is already trusted and well formed.

Applications using guzzlehttp/guzzle are affected in the same way through Guzzle's use of PSR-7. Guzzle derives the request Host header from the request URI, and its cookie matching and no_proxy proxy-bypass matching both read Uri::getHost(). An application that builds a Guzzle request URI from attacker-controlled host input can therefore have its Host header, cookie scope, or proxy-bypass decision computed against a host that differs from the one Guzzle connects to. This is not the normal request-sending path, and an application that passes only trusted, well-formed URIs to Guzzle and never builds a request URI from attacker-controlled host input is not affected through Guzzle's standard client APIs.

Patches

The issue is patched in 2.12.3 and later. Starting in that release, guzzlehttp/psr7 rejects URI host components that contain authority delimiters, an embedded port, or IPv6 brackets that do not frame the host, both when parsing a URI and via Uri::withHost(), so Uri::getHost() agrees with the URI authority. A framed bracketed literal whose contents are not a valid IPv6 address is preserved rather than rejected, so getHost() still agrees with the authority.

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. Applications that parse, forward, replay, or re-serialize raw HTTP messages, or that run with attacker-controlled $_SERVER values, should validate the host before calling Message::parseRequest() or ServerRequest::fromGlobals(), and should avoid reparsing untrusted input.

References

Record
GHSA-c2w2-prh8-qm98
CVSS 3.1
4.2 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-20, CWE-436
Updated
2026-11-02
NVD 4.2

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.3, Uri::assertValidHost() does not reject URI host components containing authority delimiters, embedded ports, or malformed IPv6 brackets, allowing Uri::getHost() to disagree with the URI authority used for security or routing decisions. This issue is fixed in version 2.12.3.

Record
CVE-2026-59882
CVSS 3.1
4.2 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Weakness
CWE-436
Updated
2026-11-02
OSV 4.2

guzzlehttp/psr7: Host Confusion via Weak URI Host Validation

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.3, Uri::assertValidHost() does not reject URI host components containing authority delimiters, embedded ports, or malformed IPv6 brackets, allowing Uri::getHost() to disagree with the URI authority used for security or routing decisions. This issue is fixed in version 2.12.3.

Record
CVE-2026-59882
CVSS 3.1
4.2 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-436
Updated
2026-11-02
OSVDEBIAN-CVE-2026-59882 6.5

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.3, Uri::assertValidHost() does not reject URI host components containing authority delimiters, embedded ports, or malformed IPv6 brackets, allowing Uri::getHost() to disagree with the URI authority used for security or routing decisions. This issue is fixed in version 2.12.3.

Record
DEBIAN-CVE-2026-59882
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Updated
2026-11-02
Show 5 moreShow less
OSVGHSA-c2w2-prh8-qm98 4.2

guzzlehttp/psr7: Host Confusion via Weak URI Host Validation

Impact

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'.

You are affected if your application builds a Uri or calls Uri::withHost() with host data that is wholly or partly attacker-controlled and then relies on Uri::getHost() for a security or routing decision, such as host allowlisting or denylisting, an SSRF guard, cookie scoping, or proxy-bypass selection. You are also affected if you parse, forward, proxy, or re-serialize URIs that come from untrusted raw HTTP messages or from synthetic $_SERVER values. Because getHost() can then disagree with the real connection target, the concrete impact depends on how your application and any downstream HTTP/1.x component use the URI, and may include host-based access-control bypass, server-side request forgery, routing to an unintended host, or Host header confusion. You are not affected if every host you place into a Uri is already trusted and well formed.

Applications using guzzlehttp/guzzle are affected in the same way through Guzzle's use of PSR-7. Guzzle derives the request Host header from the request URI, and its cookie matching and no_proxy proxy-bypass matching both read Uri::getHost(). An application that builds a Guzzle request URI from attacker-controlled host input can therefore have its Host header, cookie scope, or proxy-bypass decision computed against a host that differs from the one Guzzle connects to. This is not the normal request-sending path, and an application that passes only trusted, well-formed URIs to Guzzle and never builds a request URI from attacker-controlled host input is not affected through Guzzle's standard client APIs.

Patches

The issue is patched in 2.12.3 and later. Starting in that release, guzzlehttp/psr7 rejects URI host components that contain authority delimiters, an embedded port, or IPv6 brackets that do not frame the host, both when parsing a URI and via Uri::withHost(), so Uri::getHost() agrees with the URI authority. A framed bracketed literal whose contents are not a valid IPv6 address is preserved rather than rejected, so getHost() still agrees with the authority.

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. Applications that parse, forward, replay, or re-serialize raw HTTP messages, or that run with attacker-controlled $_SERVER values, should validate the host before calling Message::parseRequest() or ServerRequest::fromGlobals(), and should avoid reparsing untrusted input.

References

Record
GHSA-c2w2-prh8-qm98
CVSS 3.1
4.2 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-20, CWE-436
Updated
2026-11-02
OSVUBUNTU-CVE-2026-59882 4.2

guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.3, Uri::assertValidHost() does not reject URI host components containing authority delimiters, embedded ports, or malformed IPv6 brackets, allowing Uri::getHost() to disagree with the URI authority used for security or routing decisions. This issue is fixed in version 2.12.3.

Record
UBUNTU-CVE-2026-59882
CVSS 3.1
4.2 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Updated
2026-11-02
OSVCLSA-2026-1785554486 No score

TuxCare security update for guzzlehttp/psr7 (2 CVEs)

TuxCare rebuilt guzzlehttp/psr7 to address 2 CVEs. Fixed in 1.4.2-p2+tuxcare.

Record
CLSA-2026-1785554486
Updated
2026-11-02
OSVCLSA-2026-1786346242 No score

TuxCare security update for guzzlehttp/psr7 (1 CVE)

TuxCare rebuilt guzzlehttp/psr7 to address 1 CVE. Fixed in 1.9.1-p2+tuxcare.

Record
CLSA-2026-1786346242
Updated
2026-11-02
OSVCLSA-2026-1786527009 No score

TuxCare security update for guzzlehttp/psr7 (5 CVEs)

TuxCare rebuilt guzzlehttp/psr7 to address 5 CVEs. Fixed in 1.1.0-p1+tuxcare.

Record
CLSA-2026-1786527009
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
guzzlehttp/psr7
Packagist
before 2.12.3
2.12.3
guzzlehttp/psr7
TuxCare:Packagist
From an advisory covering 2 CVEs
1.4.2 up to 1.4.2-p2+tuxcare, plus listed versions
1.4.2-p1+tuxcare
1.4.2-p2+tuxcare
guzzlehttp/psr7
TuxCare:Packagist
1.9.1 up to 1.9.1-p2+tuxcare, plus listed versions
1.9.1-p1+tuxcare
1.9.1-p2+tuxcare
guzzlehttp/psr7
TuxCare:Packagist
From an advisory covering 5 CVEs
1.1.0 up to 1.1.0-p1+tuxcare
1.1.0-p1+tuxcare
php-guzzlehttp-psr7
Debian:12
All versions, plus listed versions
2.10.3-12.10.4-12.11.0-12.12.0-12.12.1-1
Show 24 moreShow less
2.12.3-12.12.4-12.12.5-12.13.0-12.13.1-12.4.5-12.4.5-1+deb12u12.5.0-12.6.0-12.6.1-12.6.2-12.6.2-22.6.2-32.7.0-12.7.0-22.7.0-32.7.1-12.8.0-12.8.0-22.9.0-12.9.0-23.0.0-13.1.0-13.2.0-1
None known
php-guzzlehttp-psr7
Debian:13
All versions, plus listed versions
2.10.3-12.10.4-12.11.0-12.12.0-12.12.1-1
Show 15 moreShow less
2.12.3-12.12.4-12.12.5-12.13.0-12.13.1-12.7.1-12.7.1-1+deb13u12.7.1-1+deb13u22.8.0-12.8.0-22.9.0-12.9.0-23.0.0-13.1.0-13.2.0-1
None known
php-guzzlehttp-psr7
Debian:14
before 2.12.3-1, plus listed versions
2.10.3-12.10.4-12.11.0-12.12.0-12.12.1-1
Show 5 moreShow less
2.7.1-12.8.0-12.8.0-22.9.0-12.9.0-2
2.12.3-1
guzzlehttp/psr7
Packagist
before 2.12.3, plus listed versions
1.0.01.1.01.2.01.2.11.2.2
Show 45 moreShow less
1.2.31.3.01.3.11.4.01.4.11.4.21.5.01.5.11.5.21.6.01.6.11.7.01.8.01.8.11.8.21.8.31.8.41.8.51.9.01.9.12.0.02.0.0-beta12.0.0-rc12.1.02.1.12.1.22.10.02.10.12.10.22.10.32.10.42.11.02.11.12.12.02.12.12.12.22.2.02.2.12.2.22.3.02.4.02.4.12.4.22.4.32.4.4
2.12.3
php-guzzlehttp-psr7
Ubuntu:16.04:LTS
All versions, plus listed versions
1.1.0-11.2.0-11.2.1-11.2.2-11.2.2-1build11.2.2-1ubuntu1
None known
php-guzzlehttp-psr7
Ubuntu:20.04:LTS
All versions, plus listed versions
1.4.2-0.11.4.2-0.1+deb10u2build0.20.04.1
None known
Show 4 moreShow less
Affected packages
PackageAffectedFixed
php-guzzlehttp-psr7
Ubuntu:Pro:22.04:LTS
All versions, plus listed versions
1.7.0-11.8.3-11.8.3-1ubuntu0.1~esm1
None known
php-guzzlehttp-psr7
Ubuntu:24.04:LTS
All versions, plus listed versions
2.6.0-12.6.1-12.6.2-1
None known
php-guzzlehttp-psr7
Ubuntu:25.10
All versions, plus listed versions
2.7.0-32.7.1-1
None known
php-guzzlehttp-psr7
Ubuntu:26.04:LTS
All versions, plus listed versions
2.7.1-12.8.0-12.8.0-2
None known

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-59882 is a medium vulnerability (CVSS 4.2) in Guzzle Psr7, published July 8, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.32%, the 24th percentile. Fixed in guzzlehttp/psr7 2.12.3.

References

Show 5 moreShow less
This page doesn't list everything

Left out here: 13 versions. The JSON record has them.

MoveEnter Open