HIGH 7.4

CVE-2026-9697: Undici ProxyAgent SOCKS5 Certificate Pinning Bypass

Undici's ProxyAgent, a popular Node.js HTTP client library, has a configuration flaw affecting SOCKS5 proxies. When you configure the library to use a SOCKS5 proxy and also set custom TLS options (like pinning to your internal certificate authority), those TLS settings are silently ignored. Instead, the library falls back to the default public CA bundle, making it possible for an attacker on the network to intercept and modify HTTPS traffic. This breaks certificate pinning strategies that many organizations rely on for security. The issue affects versions 7.23.0 through 7.27.x in the v7 branch and earlier versions in the v8 branch.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.4 HIGH · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Weaknesses (CWE)
CWE-295
Affected products
1 configuration(s)
Published / Modified
2026-06-17 / 2026-07-21

NVD description (verbatim)

Impact: undici's ProxyAgent silently drops the requestTls option when configured with a SOCKS5 proxy URI (socks5:// or socks://). The target HTTPS connection through the SOCKS5 tunnel falls back to Node's default trust store, ignoring user-configured ca, cert, key, rejectUnauthorized, and servername settings. Applications that pin to an internal or corporate CA via requestTls.ca will, when their proxy URI is SOCKS5, get the default Mozilla CA bundle as the trust anchor instead. Any cert signed by any publicly-trusted CA for the target hostname is accepted, breaking the intended pin and enabling MITM read and tamper of the HTTPS exchange. Affected applications are those that use undici's ProxyAgent (or Socks5ProxyAgent directly) with SOCKS5 AND rely on requestTls for TLS scope restriction. The bug was introduced in undici 7.23.0 when SOCKS5 support was added. Patches: Upgrade to undici v7.28.0 or v8.5.0. Workarounds: No workaround is available within the SOCKS5 path. If a SOCKS5 proxy with TLS scope restriction is required and an upgrade is not yet possible, route the traffic through an HTTP-proxy ProxyAgent instead, where requestTls is honored correctly.

17 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-9697 describes a silent configuration drop in undici's ProxyAgent implementation when using SOCKS5 URIs (socks5:// or socks://). The requestTls parameter bundle—which includes ca, cert, key, rejectUnauthorized, and servername options—is not properly passed through to the underlying TLS connection. Instead, the HTTPS connection through the SOCKS5 tunnel uses Node.js's default trust store, which trusts the Mozilla CA bundle. This means any certificate signed by a public CA for the target hostname will be accepted, regardless of pinning policies configured in requestTls. The bug was introduced when SOCKS5 support was added in version 7.23.0. HTTP proxies do not exhibit this issue; they correctly honor requestTls configuration.

Business impact

For organizations using undici with certificate pinning (a common control to prevent MITM attacks against internal or partner APIs), switching to a SOCKS5 proxy inadvertently removes that protection without any warning or error. This creates a window where HTTPS traffic to pinned endpoints can be intercepted and modified by an attacker with network visibility. The silent nature of the failure makes it especially dangerous: configuration looks correct, but is not enforced. Applications relying on internal CAs, mTLS, or strict certificate validation for compliance or security posture are most at risk. Impact ranges from data exfiltration to tampering with API responses or sensitive payloads.

Affected systems

Affected systems are those running Node.js applications that use undici's ProxyAgent or Socks5ProxyAgent with a SOCKS5 proxy URI and that also rely on requestTls configuration for TLS certificate validation or pinning. Undici versions 7.23.0 through 7.27.x and 8.0.0 through 8.4.x are vulnerable. Version 8.5.0 and 7.28.0 and later contain the fix. Any application that upgraded undici primarily for SOCKS5 support (introduced in 7.23.0) without realizing requestTls would not be honored is a candidate for exposure.

Exploitability

Exploitation requires network-level access (man-in-the-middle position) between the application and the target HTTPS endpoint. An attacker must be able to intercept traffic or control the network path—this could be an untrusted network, a compromised proxy hop, a BGP hijack, or DNS spoofing. The attack surface is elevated in environments where SOCKS5 proxies are used to route traffic through untrusted networks or where the proxy itself is not fully controlled. No interaction or special conditions are required beyond deploying a vulnerable version with SOCKS5 proxy configuration; the flaw is silently triggered by configuration alone.

Remediation

Upgrade undici to version 7.28.0 or later (for the v7 branch) or version 8.5.0 or later (for the v8 branch). Review your dependency management and ensure all transitive dependencies that pull in undici are also updated. If an immediate upgrade is not possible and SOCKS5 proxy with TLS scope restriction is required, route traffic through an HTTP-proxy ProxyAgent instead, where requestTls is correctly honored. Audit your deployment to confirm which applications use both SOCKS5 proxies and requestTls; these are the highest-priority targets for patching.

Patch guidance

Apply the patch by upgrading undici to v7.28.0 or v8.5.0 or later. These versions restore the proper handling of requestTls configuration in SOCKS5 paths. Verify the upgrade by reviewing package-lock.json or yarn.lock to confirm the installed version. No configuration changes are required after patching; existing requestTls settings will then be honored correctly. Test in a staging environment if possible to confirm that TLS handshakes and certificate validation behave as expected after the upgrade.

Detection guidance

Review application code and configuration to identify any use of ProxyAgent or Socks5ProxyAgent with a SOCKS5 URI. Check for simultaneous use of requestTls parameters (ca, cert, key, rejectUnauthorized, servername). Examine package-lock.json or yarn.lock to identify undici versions between 7.23.0–7.27.x or 8.0.0–8.4.x. Monitor TLS handshake logs or use packet inspection to see if HTTPS connections through SOCKS5 proxies are accepting certificates outside the intended trust anchor. Also audit reverse DNS records and certificate transparency logs for unexpected certificates issued for your internal or pinned hostnames during the vulnerable window.

Why prioritize this

This vulnerability merits urgent attention because it silently breaks a critical security control (certificate pinning) without alerting operators. The CVSS score of 7.4 reflects high impact on confidentiality and integrity. While it requires network-level access, the combination of silent failure, the prevalence of SOCKS5 in enterprise proxy architectures, and the potential for compliance violations (PCI-DSS, HIPAA, etc. often require certificate pinning) makes this a priority. Organizations using SOCKS5 should patch within days, not weeks.

Risk score, explained

The CVSS 3.1 score of 7.4 (HIGH) reflects: (1) high impact on confidentiality (C:H) and integrity (I:H) via certificate pinning bypass; (2) attack vector of network (AV:N); (3) attack complexity of high (AC:H) due to the need for network-level positioning; (4) no privilege required (PR:N) and no user interaction (UI:N); (5) scope unchanged (S:U). The score accurately captures the severity of a silent configuration flaw that enables MITM attacks. It does not increase further because exploitation does require positioning, and availability is not impacted.

Frequently asked questions

Does this affect applications using HTTP proxies instead of SOCKS5?

No. The vulnerability is specific to SOCKS5 proxy URIs. Applications using HTTP-proxy ProxyAgent correctly honor the requestTls configuration. Only SOCKS5 (socks5:// and socks://) is affected.

Why wasn't this caught earlier, and what changed in version 7.23.0?

SOCKS5 support was added to undici in version 7.23.0. During that implementation, the requestTls parameter bundle was not properly wired into the SOCKS5 connection path. HTTP proxy support was older and already correctly handled requestTls, so the gap was not immediately obvious.

If we upgrade, will our existing requestTls configurations automatically work?

Yes. Patched versions restore the intended behavior: requestTls will be properly applied to HTTPS connections through SOCKS5 proxies. No configuration changes are required. Simply upgrade and validate in testing.

What if we cannot upgrade immediately?

If immediate patching is not possible and you need SOCKS5 with TLS scope restriction, switch to HTTP-proxy ProxyAgent for those routes. HTTP proxies honor requestTls correctly. Note that this may require changes to your proxy infrastructure or routing logic.

This analysis is provided for informational purposes and reflects the vulnerability details as of the publish date. Organizations should verify all patch versions, configurations, and workarounds against the official undici release notes and GitHub advisories before deployment. Network testing and staging validation are recommended prior to production patching. SEC.co makes no warranty regarding the completeness or accuracy of workarounds or detection methods described herein; consult your vendor and security team for guidance specific to your environment. Source: NVD (public-domain), retrieved 2026-07-27. Analysis generated by SEC.co (claude-haiku-4-5).