CVE-2026-6734: undici vulnerable to cross-origin request routing via SOCKS5 proxy pool reuse
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 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.
Other sources
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 PR #4385 and affects all versions through 8.1.0.
Patches: Upgrade to undici v7.26.0 or v8.2.0.
Workarounds: Use a separate Socks5ProxyAgent instance per origin, or avoid using Socks5ProxyAgent with multiple origins.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 8.2.0 - Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 7.28.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.26.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.2.0 - Compensating control
Use a separate Socks5ProxyAgent instance per origin (or avoid using Socks5ProxyAgent with multiple origins) to prevent undici from reusing a single connection pool across different origins without verifying the pool's origin.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-6734?
The severity of CVE-2026-6734 is classified as high with a score of 7.5.
How does CVE-2026-6734 affect the undici library?
CVE-2026-6734 affects the undici library by allowing cross-origin request routing via the reuse of a SOCKS5 proxy connection pool without verifying the origin.
What are the potential impacts of CVE-2026-6734?
The potential impacts of CVE-2026-6734 include unauthorized access to different origins due to incorrect routing of requests.
How can I mitigate the risks associated with CVE-2026-6734?
To mitigate the risks associated with CVE-2026-6734, ensure that the undici library is updated to a version that addresses this vulnerability.
What is the recommended action for users of undici concerning CVE-2026-6734?
The recommended action for users of undici is to review their usage of the Socks5ProxyAgent and update to a secure version as soon as possible.