undici Library Vulnerable to Cross-Origin Request Routing via SOCKS5 Proxy Reuse (CVE-2026-6734)
The undici library, when using `Socks5ProxyAgent`, is vulnerable to cross-origin request routing if a single connection pool is reused across different origins, potentially misdirecting requests and credentials, trusting responses from the wrong origin, and silently downgrading HTTPS requests to HTTP (CVE-2026-6734).
The undici Node.js HTTP/1.1 client library contains a high-severity vulnerability, identified as CVE-2026-6734, impacting its Socks5ProxyAgent component. This flaw, introduced in undici version 7.23.0 and affecting all versions up to 8.1.0, allows for cross-origin request routing. When an application uses Socks5ProxyAgent (either directly or via setGlobalDispatcher) and makes requests to multiple distinct origins, the library incorrectly reuses a single SOCKS5 connection pool without verifying that the pool's established origin matches the intended destination of subsequent requests. This misrouting can lead to sensitive data exposure, such as credentials, being sent to unintended destinations, and can cause HTTPS requests to be silently downgraded to HTTP, undermining security. This vulnerability is critical for applications that interact with various services through a shared SOCKS5 proxy agent.
Attack Chain
- An application initializes and configures
undicito use aSocks5ProxyAgentfor outgoing network requests, either globally viasetGlobalDispatcheror locally. - The application makes its first request to an
origin_A(e.g.,malicious-domain.com) through the configuredSocks5ProxyAgent. undiciestablishes a connection pool toorigin_Avia the SOCKS5 proxy, associating this pool with the first requested origin.- Subsequently, the application attempts to make a request to a legitimate
origin_B(e.g.,secure-service.com) using the sameSocks5ProxyAgentinstance. - Due to the vulnerability,
undicireuses the existing connection pool (which was established fororigin_A) for the request toorigin_B, without validating the target origin. - As a result, sensitive request data, including credentials, intended for
origin_Bis misdirected and sent toorigin_Athrough the established SOCKS5 proxy connection. - The application may then receive and trust responses from
origin_A, mistakenly believing they originated fromorigin_B, leading to data corruption or further compromise. - Furthermore, if
origin_Asupports HTTP and the connection was established as such, HTTPS requests intended fororigin_Bcan be silently downgraded to HTTP, compromising encryption and integrity.
Impact
The primary impact of this vulnerability is the unintended exposure of sensitive data and potential compromise of application integrity. Applications that utilize Socks5ProxyAgent and interact with multiple origins are at risk. Credentials and request bodies intended for one origin can be misdirected to another, allowing an attacker to intercept or manipulate data. This can lead to unauthorized access, data breaches, and service disruption. Additionally, the silent downgrade of HTTPS requests to HTTP strips away crucial transport layer security, making communications vulnerable to eavesdropping and tampering. There is no specific victim count or sector information available, but any Node.js application using vulnerable versions of undici in the described configuration is affected.
Recommendation
- Immediately upgrade
npm/undicito versionv7.28.0orv8.2.0or later to apply the official patches for CVE-2026-6734. - If immediate upgrade is not possible, implement the recommended workarounds by using a separate
Socks5ProxyAgentinstance per origin forundicior avoid usingSocks5ProxyAgentwith multiple origins. - Deploy the provided Sigma rules to detect anomalous network traffic from
node.exeprocesses that might indicate misrouted requests, specifically observing for connections to private IP ranges or unexpected HTTP traffic to external hosts. - Enable comprehensive network connection logging for
node.exeprocesses on all affected operating systems to improve visibility into potential exploitation attempts.
Detection coverage 2
Detect CVE-2026-6734 Potential Exploitation - Node.js Outbound to Private IP Ranges
mediumDetects a Node.js process initiating outbound network connections to RFC1918 private IP ranges, which could indicate misrouted requests intended for external services due to CVE-2026-6734 exploitation in undici.
Detect CVE-2026-6734 Potential Exploitation - Node.js Outbound HTTP to External
mediumDetects a Node.js process initiating outbound HTTP connections to external public IP addresses on standard HTTP port 80, which could indicate silent HTTPS downgrade due to CVE-2026-6734 exploitation in undici.
Detection queries are available on the platform. Get full rules →