CVE-2022-31042Failure to strip the Cookie header on change in host or HTTP downgrade in Guzzle
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.
What to do
Fixed builds are available from Debian, Packagist: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | guzzle | Fix pending | UBUNTU-CVE-2022-31042 | |
| Ubuntu 26.04 | guzzle | Under investigation | UBUNTU-CVE-2022-31042 | |
| Ubuntu 25.10 | guzzle | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31042 | |
| Ubuntu 24.04 | guzzle | Under investigation | UBUNTU-CVE-2022-31042 | |
| Debian 14 | guzzle | Fixed | 7.4.4-1 | DEBIAN-CVE-2022-31042 |
| Debian 14 | mediawiki | Fixed | 1:1.35.7-1 | DEBIAN-CVE-2022-31042 |
| Debian 13 | guzzle | Fixed | 7.4.4-1 | DEBIAN-CVE-2022-31042 |
| Debian 13 | mediawiki | Fixed | 1:1.35.7-1 | DEBIAN-CVE-2022-31042 |
| Debian 12 | guzzle | Fixed | 7.4.4-1 | DEBIAN-CVE-2022-31042 |
| Debian 12 | mediawiki | Fixed | 1:1.35.7-1 | DEBIAN-CVE-2022-31042 |
| Packagist library | guzzlehttp/guzzle | Fixed | 6.5.7 | GHSA-w248-ffj2-4v5q |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- guzzle: affected: < 6.5.7, >=7.0.0, < 7.4.4
Vendor advisories:
- https://www.debian.org/security/2022/dsa-5246 (vendor-advisory)
References
- https://github.com/guzzle/guzzle/security/advisories/GHSA-f2wf-25xc-69c9
- https://github.com/guzzle/guzzle/commit/e3ff079b22820c2029d4c2a87796b6a0b8716ad8
- https://www.rfc-editor.org/rfc/rfc9110.html#name-redirection-3xx
- https://www.drupal.org/sa-core-2022-011
- https://www.debian.org/security/2022/dsa-5246
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.