Improper Certificate Validation Affecting undici package, versions >=4.8.2 <5.5.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.12% (48th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-UNDICI-2928996
  • published17 Jun 2022
  • disclosed17 Jun 2022
  • creditpimterry

Introduced: 17 Jun 2022

CVE-2022-32210  (opens in a new tab)
CWE-295  (opens in a new tab)

How to fix?

Upgrade undici to version 5.5.1 or higher.

Overview

undici is an An HTTP/1.1 client, written from scratch for Node.js

Affected versions of this package are vulnerable to Improper Certificate Validation due to Undici.ProxyAgent missing verification of the remote server's certificate, which leads to exposure of all the requests and responses data to the proxy.

PoC:

setGlobalDispatcher(new ProxyAgent('http://localhost:8000/')) // HTTP Proxy
// or
undici.request('https://example.com/', { dispatcher: new ProxyAgent('http://localhost:8000') }) // HTTP Proxy
// or
fetch('https://example.com/', { dispatcher: new ProxyAgent('http://localhost:8000') }) // HTTP Proxy

Workarounds:

If upgrading is not possible - avoid using ProxyAgent as a dispatcher for TLS Connections.

CVSS Scores

version 3.1