VDB
KO
HIGH 7.5

GHSA-hm92-r4w5-c3mj

undici vulnerable to cross-origin request routing via SOCKS5 proxy pool reuse

Details

## Impact

When using `Socks5ProxyAgent`, undici reuses a single connection pool across different origins without verifying that the pool's origin matches the requested origin. All requests are dispatched through the pool connected to the first origin, regardless of the intended destination.

This causes cross-origin request routing: credentials and request data intended for origin B are sent to origin A, responses from the wrong origin are trusted, and HTTPS requests may be silently downgraded to HTTP.

Impacted users are applications that use `Socks5ProxyAgent` (directly or via `setGlobalDispatcher`) and make requests to more than one origin.

This was introduced in undici 7.23.0 via [#4385](https://github.com/nodejs/undici/pull/4385) and affects all versions through 8.1.0.

## Patches

Upgrade to undici v7.28.0 or v8.2.0

## Workarounds

Use a separate `Socks5ProxyAgent` instance per origin, or avoid using `Socks5ProxyAgent` with multiple origins.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm / undici
Introduced in: 7.23.0 Fixed in: 7.28.0
Fix npm install undici@7.28.0
npm / undici
Introduced in: 8.0.0 Fixed in: 8.2.0
Fix npm install undici@8.2.0

References