undici certificate validation bypass in EnvHttpProxyAgent
Only affects undici 6.14.0 through 6.29.1, 7.0.0 through 7.30.3, and 8.0.0 through 8.14.0 when an application passes target TLS options to EnvHttpProxyAgent. Fixed in 6.29.2, 7.30.4, and 8.14.1.
- Exploited
- No known exploitation
- Fix
- Fixed in 6.29.2, 7.30.4, 8.14.1
- Who is exposed
- Not reported
Summary
The undici HTTP client for Node.js drops the application's target TLS settings when EnvHttpProxyAgent sends a request directly or through a proxy, so connections fall back to the default trust store and hostname check. A remote attacker who can present a publicly trusted certificate for the target host, without logging in, can intercept connections that the application expected to be pinned or limited to a private CA.
Written by a model
Original description
undici is an HTTP client for Node.js. In versions 6.14.0 through 6.29.1, 7.0.0 through 7.30.3, and 8.0.0 through 8.14.0, EnvHttpProxyAgent picks a direct or proxied route for each request from the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables but applies the application's target TLS options on only one of those routes. Options passed as requestTls are dropped when a request goes direct, either because no proxy variable is set or because the host matches NO_PROXY, and options passed as connect are dropped when a request is tunnelled through a proxy, so the TLS connection to the target is made without the application's ca, checkServerIdentity, servername, client certificate, or rejectUnauthorized settings and silently falls back to the default trust store and hostname check. Because the deployment environment selects the route, the same code can enforce a private CA or certificate pinning in one environment and accept any publicly trusted certificate in another, letting an attacker who can present a publicly trusted certificate for the target host intercept connections the application expected to be pinned. The issue is fixed in undici 6.29.2, 7.30.4, and 8.14.1, and users should upgrade to one of those versions or later. As a workaround, pass the same target TLS options as both requestTls and connect, or use Agent or ProxyAgent explicitly instead of EnvHttpProxyAgent.
Who should check
Teams running Node.js services with undici 6.14.0-6.29.1, 7.0.0-7.30.3 or 8.0.0-8.14.0 that use EnvHttpProxyAgent with target TLS options such as a private CA or certificate pinning.
“All releases since EnvHttpProxyAgent was introduced in undici 6.14.0 are affected.”
What to do
Upgrade to a fixed version: 6.29.2, 7.30.4, 8.14.1.
Workaround: Pass the same target TLS options as both requestTls and connect so they are applied on either route, or use Agent (direct) or ProxyAgent (proxied) explicitly instead of EnvHttpProxyAgent.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-139849 (undici vulnerable to improper certificate validation via EnvHttpProxyAgent dropping target TLS options), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-139849 (entry last updated 2026-12-05):
Affected:
- npm package undici: from 6.14.0, fixed in 6.29.2; from 7.0.0, fixed in 7.30.4; from 8.0.0, fixed in 8.14.1
Fixed versions: 6.29.2, 7.30.4, 8.14.1.
Conditions (all must be true for the bug to be hit):
- The application uses undici's EnvHttpProxyAgent, which picks direct or proxied routes from the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables. (source: https://github.com/nodejs/undici/security/advisories/GHSA-5p8q-mfqp-v63m)
- The application passes target TLS options (requestTls or connect) to EnvHttpProxyAgent, such as ca, checkServerIdentity, servername, client certificate or rejectUnauthorized. (source: https://github.com/nodejs/undici/security/advisories/GHSA-5p8q-mfqp-v63m)
- Affected releases are undici 6.14.0 through 6.29.1, 7.0.0 through 7.30.3, and 8.0.0 through 8.14.0. (source: https://github.com/nodejs/undici/security/advisories/GHSA-5p8q-mfqp-v63m)
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
Attacker needs: network access, no login, no user action.
Workaround: Pass the same target TLS options as both requestTls and connect so they are applied on either route, or use Agent (direct) or ProxyAgent (proxied) explicitly instead of EnvHttpProxyAgent. (source: https://github.com/nodejs/undici/security/advisories/GHSA-5p8q-mfqp-v63m)
CISA KEV: CVE-2026-139849 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-139849 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Packages (npm): find every lockfile in each project and run the stack.check operation of the cve.now MCP server (execute) on each one. Compare the resolved versions, not the ranges a manifest declares, with the affected versions above. Include transitive dependencies.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/nodejs/undici/security/advisories/GHSA-5p8q-mfqp-v63m
- https://cna.openjsf.org/security-advisories.html
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-139849
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-139849"}.Affected versions
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure17/25No login or user action needed, reachable over the network without a login · Unknown: Advisories don't say whether default setups are affected
- Reach20/20undici: 337.2M downloads a week
- Severity7.4/10CVSS 7.4
- No patch0/5No signal
What would change the score
- Would score about 89 if added to CISA KEV
- Would score about 84 if CISA's SSVC rates exploitation active
- Would score about 49 if advisories confirm default setups are exposed
Impact
Timeline
- CVE published
- First seen by cve.now
Evidence 4
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · nodejs/undici · Advisory GHSA-5p8q-mfqp-v63m |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-139849 |
| Record | NVD · CVE-2026-139849 |
| Other links 1 | |
| Link | cna.openjsf.org · security-advisories.html |
Questions about CVE-2026-139849
Is CVE-2026-139849 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
When EnvHttpProxyAgent sends a request directly instead of through a proxy, it drops TLS options meant for the target host, such as ca, checkServerIdentity, servername, client certificate, or rejectUnauthorized. The connection then does not use the certificate checks the application configured, so a certificate issued by any publicly trusted authority for that host can be accepted.
Source: github.com
Which versions are affected by CVE-2026-139849?
undici (npm): from 6.14.0 before 6.29.2; from 7.0.0 before 7.30.4; from 8.0.0 before 8.14.1.
Source: cve.now feed data
Am I affected, and how do I check?
Affected releases are undici 6.14.0 through 6.29.1, 7.0.0 through 7.30.3, and 8.0.0 through 8.14.0, and the setup involves EnvHttpProxyAgent with requestTls or connect options set. To check, look at the undici version in your installed package and search your code for EnvHttpProxyAgent and requestTls or connect.
Source: github.com
How do I fix CVE-2026-139849?
Upgrade undici to 6.29.2, 7.30.4, or 8.14.1, matching your release line. If upgrading is not possible, pass the same target TLS options as both requestTls and connect, or switch to Agent for direct requests or ProxyAgent for proxied requests instead of EnvHttpProxyAgent.
Source: github.com
Related
- CVE-2026-137987undici vulnerable to Denial of Service via unbounded HTTP/2 reconnection of held requests
- CVE-2026-137980undici vulnerable to Denial of Service via unbounded cache memory from tiny response chunks
- CVE-2026-139829undici vulnerable to Denial of Service via unhandled exception in stream() on request body errors
- CVE-2026-138000undici vulnerable to Denial of Service via unhandled exception resuming tuple-array header requests
- CVE-2026-141997undici vulnerable to Denial of Service via reachable assertion in the HTTP/1.1 response parser
- CVE-2026-87018undici vulnerable to Denial of Service via TLS 1.2 certificate-changing renegotiation
No corrections so far. Something wrong on this page? Report an error.