Server-Side Request Forgery (SSRF) Affecting nodejs16 package, versions <16.17.0-150300.7.9.1


Severity

Recommended
0.0
medium
0
10

Based on SUSE Linux Enterprise Server security rating.

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-SLES153-NODEJS16-3021696
  • published13 Sept 2022
  • disclosed12 Sept 2022

Introduced: 12 Sep 2022

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

How to fix?

Upgrade SLES:15.3 nodejs16 to version 16.17.0-150300.7.9.1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream nodejs16 package and not the nodejs16 package as distributed by SLES. See How to fix? for SLES:15.3 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