CVE-2022-31042:
Failure to strip the Cookie header on change in host or HTTP downgrade
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.58421%
CWE
Published
6/9/2022
Updated
7/24/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
guzzlehttp/guzzle | composer | >= 7.0.0, < 7.4.4 | 7.4.4 |
guzzlehttp/guzzle | composer | >= 4.0.0, < 6.5.7 | 6.5.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from improper handling of manually added Cookie headers during redirects. The key changes in the fix:- 1) Introduction of shouldStripSensitiveHeaders
static method to check host/scheme
changes 2) Modified modifyRequest
to remove both Authorization
and Cookie
headers based on this check 3) Made redirectUri
static. The original vulnerability existed because the Cookie
header wasn't being stripped in redirects to different hosts or HTTP
downgrades, which was addressed by adding the sensitive header stripping logic.