CVE-2024-28849: Proxy-Authorization header kept across hosts in follow-redirects
follow-redirects is an open source, drop-in replacement for Node's http and https modules that automatically follows redirects. In affected versions follow-redirects only clears authorization header during cross-domain redirect, but keep the proxy-authentication header which contains credentials too. This vulnerability may lead to credentials leak, but has been addressed in version 1.15.6. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Other sources
Node.js follow-redirects module could allow a remote authenticated attacker to obtain sensitive information, caused by the leakage of credentials when clearing authorization header during cross-domain redirect, but keeping the proxy-authentication header. An attacker could exploit this vulnerability to obtain credentials and other sensitive information.
— IBM
Proxy-Authorization header kept across hosts in follow-redirects
— Microsoft
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:
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
diff - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this.options.headers); + removeMatchingHeaders(/^(?:authorization|proxy-authorization|cookie)$/i, this.options.headers);
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/follow-redirectsto a version that resolves this vulnerability.Fixed in 1.15.6 - Upgrade
Upgrade
redhat/follow-redirectsto a version that resolves this vulnerability.Fixed in 1.15.6 - Upgrade
Upgrade
follow-redirects/follow-redirectsto a version that resolves this vulnerability.Fixed in 1.15.6 - Configuration
In follow-redirects, during cross-domain redirects, clear the Proxy-Authorization header in addition to clearing Authorization (and Cookie as applicable), because the proxy-authentication header may contain credentials and must not be kept across hosts.
follow-redirects removeMatchingHeaders (proxy-authentication) during cross-domain redirect = Remove proxy-authentication header during cross-domain redirect (i.e., include proxy-authorization in the headers to clear)
Event History
Frequently Asked Questions
What is the severity of CVE-2024-28849?
CVE-2024-28849 has been classified with a medium severity level due to its potential impact on security regarding unauthorized access.
How do I fix CVE-2024-28849?
To remediate CVE-2024-28849, upgrade the follow-redirects package to version 1.15.6 or higher.
What versions are affected by CVE-2024-28849?
CVE-2024-28849 affects versions of the follow-redirects package up to 1.15.5 inclusive.
What systems are impacted by CVE-2024-28849?
CVE-2024-28849 impacts applications using the follow-redirects package, including IBM Cognos Dashboards on Cloud Pak for Data versions up to 5.0.0.
Is CVE-2024-28849 remotely exploitable?
Yes, CVE-2024-28849 can be remotely exploited due to the handling of authorization headers during cross-domain redirects.