paypal-rest-api-specifications icon indicating copy to clipboard operation
paypal-rest-api-specifications copied to clipboard

fix: proxy-Authorization header kept across hosts follow redirects

Open imhunterand opened this issue 9 months ago • 0 comments

The project was used axios, its follow-redirects only clears authorization header during cross-domain redirect, but allows the proxy-authentication header which contains credentials too.

Steps To Reproduce & PoC

const axios = require('paypal-rest-api-specifications');
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.

This vulnerability may lead to credentials leak.

Recommended Patch

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

CVE-2024-28849 CWE-200 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

imhunterand avatar May 18 '24 09:05 imhunterand