{"id":"CVE-2026-16729","aliases":["CVE-2026-16729","GHSA-v3r7-h72x-cjcm"],"related":[],"kind":"vulnerability","state":"published","title":"undici vulnerable to cookie attribute injection via unsanitized domain and unparsed setCookie fields","summary":"undici's setCookie function does not fully sanitize cookie attributes. In undici before 6.28.0, from 7.0.0 up to before 7.29.0, and from 8.0.0 up to before 8.9.0, a domain value is not checked for semicolons and entries in the unparsed array are not sanitized, so attacker-influenced input can inject additional cookie attributes. For example, a domain value containing a semicolon can append attributes such as SameSite, and an unparsed entry can inject attributes such as HttpOnly, without the caller setting them. Applications that pass user-controlled input to these fields, such as multi-tenant or reverse-proxy servers that scope session cookies to a tenant-supplied domain, can have SameSite CSRF protections bypassed, or the Secure, HttpOnly, and SameSite attributes forced, stripped, or overridden. The issue is fixed in undici 6.28.0, 7.29.0, and 8.9.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"undici's setCookie function does not fully sanitize cookie attributes. In undici before 6.28.0, from 7.0.0 up to before 7.29.0, and from 8.0.0 up to before 8.9.0, a domain value is not checked for semicolons and entries in the unparsed array are not sanitized, so attacker-influenced input can inject additional cookie attributes. For example, a domain value containing a semicolon can append attributes such as SameSite, and an unparsed entry can inject attributes such as HttpOnly, without the caller setting them. Applications that pass user-controlled input to these fields, such as multi-tenant or reverse-proxy servers that scope session cookies to a tenant-supplied domain, can have SameSite CSRF protections bypassed, or the Secure, HttpOnly, and SameSite attributes forced, stripped, or overridden. The issue is fixed in undici 6.28.0, 7.29.0, and 8.9.0.","source":"cvelist"},{"lang":"en","text":"## Impact\n\nThe `setCookie` function has two attribute injection paths. `validateCookieDomain` does not reject semicolons (`validateCookiePath` already does at 0x3B), so a `domain` value like `example.com; SameSite=None` lands verbatim as `Domain=example.com; SameSite=None`. The `unparsed` array's loop only checks each entry contains `=` and does not sanitize values, so an entry like `X-Custom=val; HttpOnly` lands unchanged, injecting `HttpOnly` without the caller setting `cookie.httpOnly = true`.\n\nApplications that pass user-controlled input to these fields, typically multi-tenant or reverse-proxy servers that scope session cookies to a tenant-supplied domain, can have SameSite CSRF protections bypassed, `Secure` or `HttpOnly` forced or stripped, or the intended SameSite tier overridden.\n\n## Patches\n\nPatched in undici v6.28.0, v7.29.0, and v8.9.0.\n\n## Workarounds\n\n- Sanitize `domain` values against the RFC 1034 letter-digit-hyphen set before passing to `setCookie`.\n- Do not pass user-controlled data to the `unparsed` field.","format":"markdown","source":"ghsa"}],"published":"2026-07-29T16:45:57.001Z","modified":"2026-09-10T03:51:14.535Z","severity":{"scorer":"openjs","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},"severities":[{"scorer":"openjs","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-74"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"6.28.0","status":"affected"},{"type":"semver","version":"6.28.0","status":"unaffected"},{"type":"semver","introduced":"7.0.0","fixed":"7.29.0","status":"affected"},{"type":"semver","version":"7.29.0","status":"unaffected"},{"type":"semver","introduced":"8.0.0","fixed":"8.9.0","status":"affected"},{"type":"semver","version":"8.9.0","status":"unaffected"}],"vendor":"undici","product":"undici","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.28.0"}],"ecosystem":"npm","package":"undici","purl":"pkg:npm/undici","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"7.0.0","status":"affected","fixed":"7.29.0"}],"ecosystem":"npm","package":"undici","purl":"pkg:npm/undici","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"8.0.0","status":"affected","fixed":"8.9.0"}],"ecosystem":"npm","package":"undici","purl":"pkg:npm/undici","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"6.28.0"},{"status":"affected","introduced":"7.0.0","fixed":"7.29.0"},{"status":"affected","introduced":"8.0.0","fixed":"8.9.0"}],"vendor":"nodejs","product":"undici","cpe":"cpe:2.3:a:nodejs:undici:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nodejs/undici/security/advisories/GHSA-v3r7-h72x-cjcm","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://cna.openjsf.org/security-advisories.html","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-16729","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/commit/10d93fc332f2c8c161982dec3833201de29891b5","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/commit/3bf91ddb493e853957f3a58e155326a668ab8aef","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/commit/af7484043ee075a6f216da0ad77e1dac55199235","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/releases/tag/v6.28.0","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/releases/tag/v7.29.0","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodejs/undici/releases/tag/v8.9.0","tags":["web"],"sources":["ghsa"]}],"credits":["Zelys-DFKH","mcollina","UlisesGascon"],"assigner":"openjs","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-29T18:08:05.310Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-16729","url":"https://www.cve.org/CVERecord?id=CVE-2026-16729","licence":"CVE Terms of Use","modified":"2026-07-29T18:08:16.149Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v3r7-h72x-cjcm","url":"https://github.com/advisories/GHSA-v3r7-h72x-cjcm","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:14.535Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-16729","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-16729","licence":"Public domain","modified":"2026-08-05T15:18:55.053Z"}],"updatedAt":"2026-11-25T22:59:30.455Z","epss":{"score":0.00278,"percentile":0.12896,"date":"2026-11-30T12:00:22.000Z"}}