{"cve":"CVE-2022-35949","nvd":{"published":"2022-08-12T23:15:07.970","modified":"2026-06-17T04:52:35.147","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8},"cwes":["CWE-918"],"references":["https://github.com/nodejs/undici/commit/124f7ebf705366b2e1844dff721928d270f87895","https://github.com/nodejs/undici/releases/tag/v5.8.2","https://github.com/nodejs/undici/security/advisories/GHSA-8qr4-xgw6-wmr3","https://github.com/nodejs/undici/commit/124f7ebf705366b2e1844dff721928d270f87895","https://github.com/nodejs/undici/releases/tag/v5.8.2"],"products":["nodejs:undici"],"source":"nvd","synced_at":"2026-10-19T21:34:18.502168378+00:00"},"epss":{"cve":"CVE-2022-35949","score":0.01927,"percentile":0.79961,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-8qr4-xgw6-wmr3","url":"https://osv.dev/vulnerability/GHSA-8qr4-xgw6-wmr3","summary":"`undici.request` vulnerable to SSRF using absolute URL on `pathname`","modified":"2023-11-08T04:09:53.898548Z","packages":[{"ecosystem":"npm","name":"undici","purl":"pkg:npm/undici","ranges":["<5.8.2"],"fixed":["5.8.2"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}