// For flags

CVE-2022-35949

`undici.request` vulnerable to SSRF using absolute URL on `pathname`

Severity Score

9.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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("undici") undici.request({origin: "http://example.com", pathname: "//127.0.0.1"}) ``` 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.

undici es un cliente HTTP/1.1, escrito desde cero para Node.js."undici" es vulnerable a un ataque de tipo SSRF (Server-side Request Forgery) cuando una aplicación toma la **user input** en la opción "path/pathname" de "undici.request". Si un usuario especifica una URL como "http://127.0.0.1" o "//127.0.0.1" ""js const undici = require("undici") undici.request({origin: "http://example.com", pathname: "//127.0.0.1"}) """ En lugar de procesar la petición como "http://example.org//127.0.0.1" (o "http://example.org/http://127.0.0.1" cuando es usada "http://127.0.0.1"), en realidad procesa la petición como "http://127.0.0.1/" y la envía a "http://127.0.0.1". Si un desarrollador pasa la entrada del usuario en el parámetro "path" de "undici.request", puede resultar en un _SSRF_ ya que asumirá que el nombre del host no puede cambiar, cuando en realidad puede cambiar porque el parámetro path especificado es combinado con la URL base. Este problema ha sido corregido en "undici@5.8.1". La mejor mitigación es comprender la entrada del usuario antes de pasarla a la llamada "undici.request".

A Server-Side Request Forgery (SSRF) vulnerability was found in undici, a HTTP/1.1 client for Node.js. An attacker can manipulate the server-side application to make requests to an unintended location when they use the 'path/pathname' option in 'undici.request'.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2022-07-15 CVE Reserved
  • 2022-08-12 CVE Published
  • 2024-04-02 EPSS Updated
  • 2024-08-03 CVE Updated
  • 2024-08-03 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-918: Server-Side Request Forgery (SSRF)
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Nodejs
Search vendor "Nodejs"
Undici
Search vendor "Nodejs" for product "Undici"
<= 5.8.1
Search vendor "Nodejs" for product "Undici" and version " <= 5.8.1"
node.js
Affected