# CVE-2022-31091: Change in port should be considered a change in origin in Guzzle

- Severity: High 7.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.59%, higher than 76% of CVEs (2026-12-01)
- Published: 2022-06-21T20:07:16.000Z
- Modified: 2026-06-17T04:44:46.673Z
- Also known as: GHSA-q559-8m2m-g699
- Weaknesses: CWE-200
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

Guzzle, an extensible PHP HTTP client. `Authorization` and `Cookie` headers on requests are sensitive information. In affected versions on making a request which responds with a redirect to a URI with a different port, if we choose to follow it, we should remove the `Authorization` and `Cookie` headers from the request, before containing. Previously, we would only consider a change in host or scheme. Affected Guzzle 7 users should upgrade to Guzzle 7.4.5 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.8 or 7.4.5. Note that a partial fix was implemented in Guzzle 7.4.2, where a change in host would trigger removal of the curl-added Authorization header, however this earlier fix did not cover change in scheme or change in port. An alternative approach would be to use your own redirect middleware, rather than ours, if you are unable to upgrade. If you do not require or expect redirects to be followed, one should simply disable redirects all together.

(As written by CVE List.)

## Affected

- guzzle guzzle: < 6.5.8; >=7.0.0, < 7.4.5
- guzzlehttp/guzzle (Packagist): before 6.5.8; from 7.0.0 before 7.4.5
- guzzlephp guzzle: before 6.5.8; from 7.0.0 before 7.4.5
- debian debian_linux: 11.0

## Every score

- GitHub_M: CVSS:3.1 7.7 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`
- GitHub: CVSS:3.1 7.7 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`
- NVD: CVSS:3.1 7.7 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`
- NVD: CVSS:2.0 4.0 Medium `AV:N/AC:L/Au:S/C:P/I:N/A:N`

## References

- <https://github.com/guzzle/guzzle/commit/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82> (patch, third-party-advisory, web)
- <https://github.com/guzzle/guzzle/security/advisories/GHSA-q559-8m2m-g699> (mitigation, third-party-advisory, web)
- <https://www.debian.org/security/2022/dsa-5246> (third-party-advisory, vendor-advisory, web)
- <https://security.gentoo.org/glsa/202305-24> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31091> (advisory)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/guzzlehttp/guzzle/CVE-2022-31091.yaml> (web)
- <https://github.com/guzzle/guzzle> (package)

## Sources

- CVE List: [CVE-2022-31091](https://www.cve.org/CVERecord?id=CVE-2022-31091), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-q559-8m2m-g699](https://github.com/advisories/GHSA-q559-8m2m-g699), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-31091](https://nvd.nist.gov/vuln/detail/CVE-2022-31091), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31091 · Whole record: https://cve.day/CVE-2022-31091.json · Rebuilt by cve.day 2026-11-25T22:58:12.598Z
