CVE-2024-28849 – follow-redirects
Package
Manager: npm
Name: follow-redirects
Vulnerable Version: >=0 <1.15.6
Severity
Level: Medium
CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
EPSS: 0.00216 pctl0.44163
Details
follow-redirects' Proxy-Authorization header kept across hosts When using [axios](https://github.com/axios/axios), its dependency follow-redirects only clears authorization header during cross-domain redirect, but allows the proxy-authentication header which contains credentials too. ## Steps To Reproduce & PoC Test code: ```js const axios = require('axios'); axios.get('http://127.0.0.1:10081/', { headers: { 'AuThorization': 'Rear Test', 'ProXy-AuthoriZation': 'Rear Test', 'coOkie': 't=1' } }) .then((response) => { console.log(response); }) ``` When I meet the cross-domain redirect, the sensitive headers like authorization and cookie are cleared, but proxy-authentication header is kept. ## Impact This vulnerability may lead to credentials leak. ## Recommendations Remove proxy-authentication header during cross-domain redirect ### Recommended Patch [follow-redirects/index.js:464](https://github.com/follow-redirects/follow-redirects/commit/c4f847f85176991f95ab9c88af63b1294de8649b) ```diff - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + removeMatchingHeaders(/^(?:authorization|proxy-authorization|cookie)$/i, this._options.headers); ```
Metadata
Created: 2024-03-14T17:19:42Z
Modified: 2024-04-02T17:54:20Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/03/GHSA-cxjh-pqwp-8mfp/GHSA-cxjh-pqwp-8mfp.json
CWE IDs: ["CWE-200"]
Alternative ID: GHSA-cxjh-pqwp-8mfp
Finding: F017
Auto approve: 1