Vulnerabilities / CVE-2022-35949

critical

CVE-2022-35949

nodejs: undici.request vulnerable to SSRF

Published Modified CWE 918
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GHSA5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Red Hat5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by GHSA (medium), Red Hat (medium).

Description

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.

Affected packages and fixed versions

SourcePackageFixed in
debian 12node-undici5.8.2+dfsg1+~cs18.9.18.1-1
debian 13node-undici5.8.2+dfsg1+~cs18.9.18.1-1
debian 14node-undici5.8.2+dfsg1+~cs18.9.18.1-1
echonode-undici5.8.2+dfsg1+~cs18.9.18.1-1
npm::GitHub Security Advisory npmundici5.8.2
root.io debian 12rootio-node-undici5.8.2+dfsg1+~cs18.9.18.1-1
seal npm::Seal Security Database@seal-security/undici, undici4.16.0-sp999
Show all 8 entries from 7 sources
SourcePackageFixed in
debian 12node-undici5.8.2+dfsg1+~cs18.9.18.1-1
debian 13node-undici5.8.2+dfsg1+~cs18.9.18.1-1
debian 14node-undici5.8.2+dfsg1+~cs18.9.18.1-1
echonode-undici5.8.2+dfsg1+~cs18.9.18.1-1
npm::GitHub Security Advisory npmundici5.8.2
root.io debian 12rootio-node-undici5.8.2+dfsg1+~cs18.9.18.1-1
seal npm::Seal Security Database@seal-security/undici4.16.0-sp999
seal npm::Seal Security Databaseundici4.16.0-sp999

References

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.