CVE-2026-16729 Details
Description
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.
A vulnerability exists in the 'setCookie' function of the undici HTTP client, allowing for injection of additional cookie attributes through unsanitized domain values and unparsed entries. This issue is present in undici versions prior to 6.28.0, from 7.0.0 up to but not including 7.29.0, and from 8.0.0 up to but not including 8.9.0. The vulnerability arises because the domain attribute is not properly validated for semicolons, enabling attackers to append attributes like SameSite. Similarly, unparsed entries can inject attributes such as HttpOnly without the caller's consent. This flaw can be exploited in applications that use user-controlled input for cookie management, particularly in multi-tenant or reverse-proxy environments, potentially bypassing SameSite CSRF protections or manipulating Secure, HttpOnly, and SameSite attributes.
Users can upgrade to undici versions 6.28.0, 7.29.0, or 8.9.0 to address this vulnerability. Additionally, it is recommended to sanitize domain values against the RFC 1034 letter-digit-hyphen set before passing them to the 'setCookie' function, and to avoid using user-controlled data in the unparsed field.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 29, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://cna.openjsf.org/security-advisories.html | openjs | Vendor Advisory |
| https://github.com/nodejs/undici/security/advisories/GHSA-v3r7-h72x-cjcm | openjs | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | openjs |
Affected Products
| Product | Versions |
|---|---|
| nodejs undici | < 6.28.0 >= 7.0.0, < 7.29.0 >= 8.0.0, < 8.9.0 |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 5, 2026 | Initial Analysis | [email protected] |
| Jul 29, 2026 | CVE Modified | CISA-ADP |
| Jul 29, 2026 | New CVE Received | openjs |