Skip to content

follow-redirects' Proxy-Authorization header kept across hosts

Moderate severity GitHub Reviewed Published Mar 14, 2024 in follow-redirects/follow-redirects • Updated Apr 2, 2024

Package

npm follow-redirects (npm)

Affected versions

<= 1.15.5

Patched versions

1.15.6

Description

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

follow-redirects/index.js:464

- removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
+ removeMatchingHeaders(/^(?:authorization|proxy-authorization|cookie)$/i, this._options.headers);

References

Published by the National Vulnerability Database Mar 14, 2024
Published to the GitHub Advisory Database Mar 14, 2024
Reviewed Mar 14, 2024
Last updated Apr 2, 2024

Severity

Moderate
6.5
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Weaknesses

CVE ID

CVE-2024-28849

GHSA ID

GHSA-cxjh-pqwp-8mfp

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.