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

    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 ID SNYK-JS-UNDICI-2928996
  • published 17 Jun 2022
  • disclosed 17 Jun 2022
  • credit pimterry

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
Expand this section

Snyk

Recommended
5.4 medium
  • Attack Vector (AV)
    Adjacent
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    High
  • User Interaction (UI)
    None
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None
Expand this section

NVD

6.5 medium