Improper Certificate Validation Affecting org.webjars.npm:undici package, versions [4.8.2,5.5.1)


0.0
medium

Snyk CVSS

    Attack Complexity High
    Privileges Required High
    Scope Changed
    Confidentiality High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.12% (46th percentile)
Expand this section
NVD
6.5 medium

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-JAVA-ORGWEBJARSNPM-2928997
  • published 17 Jun 2022
  • disclosed 17 Jun 2022
  • credit pimterry

How to fix?

Upgrade org.webjars.npm:undici to version 5.5.1 or higher.

Overview

org.webjars.npm: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.