CVE-2024-28849: follow-redirects' Proxy-Authorization header kept across hosts
When using 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: When I meet the cross-domain redirect, the sensitive headers like authorization and cookie are cleared, but proxy-authentication header is kept.
Published Mar 14, 2024 · Updated Apr 2, 2024
Affected packages
follow-redirects
- Ecosystem
- npm
- Affected
- <= 1.15.5
- Fixed in
- 1.15.6
- Check
npm ls follow-redirects
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
When using 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:
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
- removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
+ removeMatchingHeaders(/^(?:authorization|proxy-authorization|cookie)$/i, this._options.headers);Credited to 4xpl0r3r, RDIL.
References
- https://github.com/follow-redirects/follow-redirects/security/advisories/GHSA-cxjh-pqwp-8mfp
- https://github.com/follow-redirects/follow-redirects/commit/c4f847f85176991f95ab9c88af63b1294de8649b
- https://fetch.spec.whatwg.org/#authentication-entries
- https://nvd.nist.gov/vuln/detail/CVE-2024-28849
- https://github.com/psf/requests/issues/1885
- https://hackerone.com/reports/2390009
- https://lists.fedoraproject.org/archives/list/[email protected]/message/VOIF4EPQUCKDBEVTGRQDZ3CGTYQHPO7Z
- https://github.com/advisories/GHSA-cxjh-pqwp-8mfp
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-116689
follow-redirects: Cross-realm sensitiveHeaders arrays are discarded and custom credentials can follow redirects
high5.9Oct 30, 2026CVE-2026-111755
follow-redirects sensitiveHeaders regex escaping can expose credential headers
high8.2Oct 20, 2026CVE-2026-111756
follow-redirects array-form headers bypass cross-origin credential stripping
high8.2Oct 20, 2026CVE-2026-40895
follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Targets
medium6.9Apr 14, 2026CVE-2023-26159
Follow Redirects improperly handles URLs in the url.parse() function
medium6.1Jan 2, 2024
