# CVE-2022-31042: Failure to strip the Cookie header on change in host or HTTP downgrade in Guzzle

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/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.99%, higher than 81% of CVEs (2026-12-01)
- Published: 2022-06-09T00:00:00.000Z
- Modified: 2026-09-19T16:26:39.000Z
- Also known as: GHSA-f2wf-25xc-69c9, BIT-DRUPAL-2022-31042, BIT-DRUPAL-2022-31043, DRUPAL-CORE-2022-011, GHSA-w248-ffj2-4v5q
- Related: CVE-2022-31043
- Weaknesses: CWE-200, CWE-212, CWE-863
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

Guzzle is an open source PHP HTTP client. In affected versions the `Cookie` headers on requests are sensitive information. On making a request using the `https` scheme to a server which responds with a redirect to a URI with the `http` scheme, or on making a request to a server which responds with a redirect to a a URI to a different host, we should not forward the `Cookie` header on. Prior to this fix, only cookies that were managed by our cookie middleware would be safely removed, and any `Cookie` header manually added to the initial request would not be stripped. We now always strip it, and allow the cookie middleware to re-add any cookies that it deems should be there. Affected Guzzle 7 users should upgrade to Guzzle 7.4.4 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.7 or 7.4.4. Users unable to upgrade may consider an alternative approach to use your own redirect middleware, rather than ours. 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.7; >=7.0.0, < 7.4.4
- guzzlehttp/guzzle (Packagist): from 4.0.0 before 6.5.7; from 7.0.0 before 7.4.4
- drupal/core (Packagist): from 8.0.0 before 9.2.21; from 9.3.0 before 9.3.16
- guzzlephp guzzle: before 6.5.7; from 7.0.0 before 7.4.4
- drupal drupal: from 9.2.0 before 9.2.21; from 9.3.0 before 9.3.16; 9.4.0
- debian debian_linux: 11.0
- drupal (Bitnami): from 9.2.0 before 9.2.21; from 9.3.0 before 9.3.16

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:P/I:N/A:N`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/guzzle/guzzle/security/advisories/GHSA-f2wf-25xc-69c9> (advisory, third-party-advisory, web)
- <https://github.com/guzzle/guzzle/commit/e3ff079b22820c2029d4c2a87796b6a0b8716ad8> (advisory, patch, third-party-advisory, web)
- <https://www.rfc-editor.org/rfc/rfc9110.html#name-redirection-3xx> (advisory, third-party-advisory, web)
- <https://www.drupal.org/sa-core-2022-011> (advisory, patch, third-party-advisory, web)
- <https://www.debian.org/security/2022/dsa-5246> (advisory, third-party-advisory, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31042> (advisory, web)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/guzzlehttp/guzzle/CVE-2022-31042.yaml> (web)
- <https://github.com/guzzle/guzzle> (package)
- <https://github.com/guzzle/guzzle/security/advisories/GHSA-w248-ffj2-4v5q> (advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31043> (advisory, web)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/guzzlehttp/guzzle/CVE-2022-31043.yaml> (web)

## Sources

- CVE List: [CVE-2022-31042](https://www.cve.org/CVERecord?id=CVE-2022-31042), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-f2wf-25xc-69c9](https://github.com/advisories/GHSA-f2wf-25xc-69c9), CC-BY-4.0, modified 2025-12-10
- GitHub Advisory Database: [GHSA-w248-ffj2-4v5q](https://github.com/advisories/GHSA-w248-ffj2-4v5q), CC-BY-4.0, modified 2025-12-10
- Drupal Security Team: [DRUPAL-CORE-2022-011](https://osv.dev/vulnerability/DRUPAL-CORE-2022-011), MIT, modified 2026-09-19
- NVD: [CVE-2022-31042](https://nvd.nist.gov/vuln/detail/CVE-2022-31042), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-DRUPAL-2022-31042](https://osv.dev/vulnerability/BIT-DRUPAL-2022-31042), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-DRUPAL-2022-31043](https://osv.dev/vulnerability/BIT-DRUPAL-2022-31043), Apache-2.0, modified 2026-09-08

---

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