Skip to main content
EPSS 0.2%top 91%

Node undici: undici's setCookie function does not fully sanitize cookie attributes. (CVE-2026-16729)

0
Medium
Published: 07/29/2026 (07/29/2026, 17:16:00 UTC)
Source: GCVE Database
Product: node-undici

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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Affected software

Ubuntu:24.04:LTSmore threats →ghsa
node-undici
pkg:deb/ubuntu/node-undici?arch=source&distro=noble
Affected versions
=5.22.1+dfsg1+~cs20.10.10.2-1ubuntu1=5.26.3+dfsg1+~cs23.10.12-2
Ubuntu:26.04:LTSmore threats →ghsa
node-undici
pkg:deb/ubuntu/node-undici?arch=source&distro=resolute
Affected versions
=7.3.0+dfsg1+~cs24.12.11-2=7.16.0+dfsg+~cs3.2.0-2=7.18.2+dfsg+~cs3.2.0-1=7.18.2+dfsg+~cs3.2.0-1build1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/03/2026, 21:42:46 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses