CVE-2022-31033: Mechanize before v2.8.5 vulnerable to authorization header leak on port redirect
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.62468%
CWE
Published
6/9/2022
Updated
1/27/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
mechanize | rubygems | < 2.8.5 | 2.8.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper credential handling during redirects. The commit diff shows critical changes in the response_redirect method where:
- Credential headers were split into separate constants (Authorization vs Cookies)
- Logic was added to clear Authorization headers specifically when port changes
- Test cases were added to verify Authorization header removal on port redirect
This indicates the original response_redirect implementation didn't properly handle port-based redirect credential isolation, specifically for Authorization headers, while correctly preserving cookies per RFC 6265.