Server-Side Request Forgery (SSRF) Affecting node-undici package, versions <5.8.2+dfsg1+~cs18.9.18.1-1


Severity

Recommended
0.0
critical
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
0.31% (70th 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 Learn

Learn about Server-Side Request Forgery (SSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-DEBIAN13-NODEUNDICI-5690525
  • published14 Aug 2022
  • disclosed12 Aug 2022

Introduced: 12 Aug 2022

CVE-2022-35949  (opens in a new tab)
CWE-918  (opens in a new tab)

How to fix?

Upgrade Debian:13 node-undici to version 5.8.2+dfsg1+~cs18.9.18.1-1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream node-undici package and not the node-undici package as distributed by Debian. See How to fix? for Debian:13 relevant fixed versions and status.

undici is an HTTP/1.1 client, written from scratch for Node.js.undici is vulnerable to SSRF (Server-side Request Forgery) when an application takes in user input into the path/pathname option of undici.request. If a user specifies a URL such as http://127.0.0.1 or //127.0.0.1 js const undici = require(&#34;undici&#34;) undici.request({origin: &#34;http://example.com&#34;, pathname: &#34;//127.0.0.1&#34;}) Instead of processing the request as http://example.org//127.0.0.1 (or http://example.org/http://127.0.0.1 when http://127.0.0.1 is used), it actually processes the request as http://127.0.0.1/ and sends it to http://127.0.0.1. If a developer passes in user input into path parameter of undici.request, it can result in an SSRF as they will assume that the hostname cannot change, when in actual fact it can change because the specified path parameter is combined with the base URL. This issue was fixed in undici@5.8.1. The best workaround is to validate user input before passing it to the undici.request call.

CVSS Scores

version 3.1