Node undici: undici's setCookie function does not fully sanitize cookie attributes. (CVE-2026-16729)
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.
AI Analysis
Technical Summary
CVE-2026-16729 describes a vulnerability in the undici HTTP client library's setCookie function, which has two injection paths for cookie attributes. The validateCookieDomain function fails to reject semicolons in domain values, allowing injection of additional cookie attributes like SameSite=None. Additionally, the unparsed array loop only checks for '=' presence but does not sanitize values, permitting injection of attributes such as HttpOnly without the caller explicitly setting them. This can cause security attributes to be forced, stripped, or overridden, potentially bypassing SameSite CSRF protections. The vulnerability primarily impacts applications passing user-controlled input to these fields, such as multi-tenant or reverse-proxy servers. Official patches are available in undici versions 6.28.0, 7.29.0, and 8.9.0.
Potential Impact
The vulnerability allows attackers to inject arbitrary cookie attributes via unsanitized domain and unparsed setCookie fields. This can lead to bypassing SameSite CSRF protections, forcibly setting or stripping Secure or HttpOnly flags, or overriding intended SameSite cookie tiers. The impact is limited to scenarios where user-controlled input is passed to these cookie attributes, commonly in multi-tenant or reverse-proxy server contexts. The CVSS 3.1 base score is 4.8 (medium severity), reflecting network attack vector with high attack complexity and no privileges or user interaction required, causing limited confidentiality and integrity impact without availability impact.
Mitigation Recommendations
A fix is available in undici versions 6.28.0, 7.29.0, and 8.9.0. Users should upgrade to one of these patched versions to remediate the vulnerability. As a workaround, sanitize domain values against the RFC 1034 letter-digit-hyphen set before passing them to setCookie, and avoid passing user-controlled data to the unparsed field. These mitigations reduce the risk until upgrading is possible.
Node undici: undici's setCookie function does not fully sanitize cookie attributes. (CVE-2026-16729)
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.
CVSS v3.1
Score 6.5medium
Affected software
pkg:deb/ubuntu/node-undici?arch=source&distro=noblepkg:deb/ubuntu/node-undici?arch=source&distro=resoluteRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-16729 describes a vulnerability in the undici HTTP client library's setCookie function, which has two injection paths for cookie attributes. The validateCookieDomain function fails to reject semicolons in domain values, allowing injection of additional cookie attributes like SameSite=None. Additionally, the unparsed array loop only checks for '=' presence but does not sanitize values, permitting injection of attributes such as HttpOnly without the caller explicitly setting them. This can cause security attributes to be forced, stripped, or overridden, potentially bypassing SameSite CSRF protections. The vulnerability primarily impacts applications passing user-controlled input to these fields, such as multi-tenant or reverse-proxy servers. Official patches are available in undici versions 6.28.0, 7.29.0, and 8.9.0.
Potential Impact
The vulnerability allows attackers to inject arbitrary cookie attributes via unsanitized domain and unparsed setCookie fields. This can lead to bypassing SameSite CSRF protections, forcibly setting or stripping Secure or HttpOnly flags, or overriding intended SameSite cookie tiers. The impact is limited to scenarios where user-controlled input is passed to these cookie attributes, commonly in multi-tenant or reverse-proxy server contexts. The CVSS 3.1 base score is 4.8 (medium severity), reflecting network attack vector with high attack complexity and no privileges or user interaction required, causing limited confidentiality and integrity impact without availability impact.
Mitigation Recommendations
A fix is available in undici versions 6.28.0, 7.29.0, and 8.9.0. Users should upgrade to one of these patched versions to remediate the vulnerability. As a workaround, sanitize domain values against the RFC 1034 letter-digit-hyphen set before passing them to setCookie, and avoid passing user-controlled data to the unparsed field. These mitigations reduce the risk until upgrading is possible.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- UBUNTU-CVE-2026-16729
- Osv Schema Version
- 1.7.0
- Ecosystems
- ["Ubuntu:24.04:LTS","Ubuntu:26.04:LTS"]
- Cvss Version
- 3.1
Threat ID: 6a6cc1b71aa972dd320c2c24
Added to database: 07/31/2026, 15:39:35 UTC
Last enriched: 08/03/2026, 21:42:46 UTC
Last updated: 09/12/2026, 10:01:29 UTC
Views: 31
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.