CVE-2022-32210: Undici ProxyAgent Vulnerable To MITM Vulnerability
HIGHCVE-2022-32210 is a HIGH (CVSS 7.7) proxyagent vulnerable to mitm vulnerability (CWE-295: Improper Certificate Validation) affecting Undici libraries in the npm ecosystem. The issue involves proxyagent vulnerable to mitm. Remediation is available by upgrading affected packages to version 5.5.1.
CVE-2022-32210 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:N).
How to Fix CVE-2022-32210
To remediate this vulnerability, upgrade all affected Undici dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install undici@5.5.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls undici
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-32210, inspect your project dependencies using npm:
npm ls undici
Analyze the terminal output to locate any version of Undici in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.5.1), your application is affected.
Note: The npm ls undici command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. In Undici, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-32210 Affected Undici Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
undici
|
npm |
≥ 4.8.2
< 5.5.1
|
5.5.1
|
References
Frequently Asked Questions
What is CVE-2022-32210?
Which Undici versions are affected?
What version fixes CVE-2022-32210?
Is undici affected?
What is the CVSS score of CVE-2022-32210?
What CWE is associated with CVE-2022-32210?
How can I check npm dependencies for CVE-2022-32210?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pgw7-wx7w-2w33",
"modified" : "2022-07-29T18:13:25Z",
"published" : "2022-06-17T01:02:29Z",
"aliases" : [ "CVE-2022-32210" ],
"summary" : "ProxyAgent vulnerable to MITM",
"details" : "### Description\n\n`Undici.ProxyAgent` never verifies the remote server's certificate, and always exposes all request & response data to the proxy. This unexpectedly means that proxies can MitM all HTTPS traffic, and if the proxy's URL is HTTP then it also means that nominally HTTPS requests are actually sent via plain-text HTTP between Undici and the proxy server.\n\n### Impact\n\nThis affects all use of HTTPS via HTTP proxy using **`Undici.ProxyAgent`** with Undici or Node's global `fetch`. In this case, it removes all HTTPS security from all requests sent using Undici's `ProxyAgent`, allowing trivial MitM attacks by anybody on the network path between the client and the target server (local network users, your ISP, the proxy, the target server's ISP, etc).\nThis less seriously affects HTTPS via HTTPS proxies. When you send HTTPS via a proxy to a remote server, the proxy can freely view or modify all HTTPS traffic unexpectedly (but only the proxy). \n\n### Patches\n\nThis issue was patched in Undici v5.5.1.\n\n### Workarounds\n\nAt the time of writing, the only workaround is to not use `ProxyAgent` as a dispatcher for TLS Connections.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "undici"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.8.2"
}, {
"fixed" : "5.5.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.5.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nodejs/undici/security/advisories/GHSA-pgw7-wx7w-2w33"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-32210"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/1583680"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nodejs/undici"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-295" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T01:02:29Z",
"nvd_published_at" : "2022-07-14T15:15:00Z"
}
}