Improper Certificate Validation Affecting undici Open this link in a new tab package, versions >=4.8.2 <5.5.1


0.0
medium
  • Exploit Maturity

    Proof of concept

  • Attack Complexity

    High

  • Privileges Required

    High

  • Scope

    Changed

  • Confidentiality

    High

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.