CVE-2022-31090: CURLOPT_HTTPAUTH option not cleared on change of origin
7.7
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.87491%
CWE
Published
6/21/2022
Updated
7/24/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| guzzlehttp/guzzle | composer | < 6.5.8 | 6.5.8 |
| guzzlehttp/guzzle | composer | >= 7.0.0, < 7.4.5 | 7.4.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from incomplete origin validation when handling redirects. The commit shows the check for CURLOPT_HTTPAUTH removal was originally based solely on host comparison (request->getUri()->getHost() !== nextRequest->getUri()->getHost()). The shouldStripSensitiveHeaders method only checked host mismatch and HTTP->HTTPS downgrades, missing port changes. These functions failed to properly clear authentication options when redirecting to different ports or schemes, allowing credentials to leak. The fix replaced these checks with Psr7\UriComparator::isCrossOrigin which properly validates host, port, and scheme changes.