Miggo Logo

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

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.58421%
Published
6/9/2022
Updated
7/24/2023
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
guzzlehttp/guzzlecomposer>= 7.0.0, < 7.4.47.4.4
guzzlehttp/guzzlecomposer>= 4.0.0, < 6.5.76.5.7

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t `*ooki*` *****rs on r*qu*sts *r* s*nsitiv* in*orm*tion. On m*kin* * r*qu*st usin* t** `*ttps` s***m* to * s*rv*r w*i** r*spon*s wit* * r**ir**t to * URI wit* t** `*ttp` s***m*, or on m*kin* * r*qu*st to * s*rv*r w*i** r*spon*s wit* * r**i

Reasoning

T** vuln*r**ility st*mm** *rom improp*r **n*lin* o* m*nu*lly ***** *ooki* *****rs *urin* r**ir**ts. T** k*y ***n**s in t** *ix:- *) Intro*u*tion o* `s*oul*StripS*nsitiv******rs` st*ti* m*t*o* to ****k `*ost/s***m*` ***n**s *) Mo*i*i** `mo*i*yR*qu*st`