{"id":"CVE-2022-35949","aliases":["GHSA-8qr4-xgw6-wmr3"],"url":"https://o3.security/vulnerability/CVE-2022-35949","summary":"`undici.request` vulnerable to SSRF using absolute URL on `pathname`","details":"### Impact\n\n`undici` is vulnerable to SSRF (Server-side Request Forgery) when an application takes in **user input** into the `path/pathname` option of `undici.request`.\n\nIf a user specifies a URL such as `http://127.0.0.1` or `//127.0.0.1`\n\n```js\nconst undici = require(\"undici\")\nundici.request({origin: \"http://example.com\", pathname: \"//127.0.0.1\"})\n```\n\nInstead 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`.\n\nIf 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.\n\n### Patches\n\nThis issue was fixed in `undici@5.8.1`.\n\n### Workarounds\n\nThe best workaround is to validate user input before passing it to the `undici.request` call.\n\n## For more information\nIf you have any questions or comments about this advisory:\n\n- Open an issue in [undici repository](https://github.com/nodejs/undici/issues)\n- To make a report, follow the [SECURITY](https://github.com/nodejs/node/blob/HEAD/SECURITY.md) document\n","published":"2022-08-12T00:00:00Z","modified":"2026-10-28T02:31:03.879380223Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":1,"affectedPackages":[{"ecosystem":"npm","name":"undici","fixedVersion":"5.8.2"}],"fix":{"url":"https://github.com/nodejs/undici/commit/124f7ebf705366b2e1844dff721928d270f87895","label":"nodejs/undici@124f7eb"},"references":[{"type":"WEB","url":"https://github.com/nodejs/undici/releases/tag/v5.8.2"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35949.json"},{"type":"ADVISORY","url":"https://github.com/nodejs/undici/security/advisories/GHSA-8qr4-xgw6-wmr3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35949"},{"type":"FIX","url":"https://github.com/nodejs/undici/commit/124f7ebf705366b2e1844dff721928d270f87895"},{"type":"PACKAGE","url":"https://github.com/nodejs/undici"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:31:03.879380223Z"}}