LOW 3.7

CVE-2026-11525: Undici Set-Cookie SameSite Parsing Vulnerability

Undici, a Node.js HTTP client library, incorrectly parses the SameSite attribute in Set-Cookie headers. Instead of validating that the attribute is exactly 'Strict', 'Lax', or 'None' as the HTTP specification requires, undici accepts any value containing one of those words as a substring and silently converts it to the closest match. This means a server sending a malformed cookie like 'SameSite=NoneOfYourBusiness' will be treated as 'None'—the least restrictive setting—potentially weakening the security properties applications expect from SameSite enforcement.

Source data · NVD / CISA · public domain

CVSS
3.1 · 3.7 LOW · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
Weaknesses (CWE)
CWE-183
Affected products
1 configuration(s)
Published / Modified
2026-06-17 / 2026-06-25

NVD description (verbatim)

Impact: When undici parses a Set-Cookie header, it accepts any SameSite attribute value that contains Strict, Lax, or None as a substring, rather than the case-insensitive exact match specified by RFC 6265. Non-spec values are silently mapped to one of the three standard tokens. For example, SameSite=NoneOfYourBusiness is parsed as None (the most permissive setting), and SameSite=StrictLax is parsed as Lax (a downgrade from Strict). Affected applications are those that consume Set-Cookie headers from server responses (for example via undici's fetch or proxy code paths) and then forward or rely on the parsed sameSite attribute. A malicious or non-compliant server can coerce the consumer's view of a cookie's SameSite policy to a weaker value, silently degrading the SameSite enforcement the cookie is supposed to provide. This was introduced in undici 5.15.0 when the cookies feature was added. Patches: Upgrade to undici v6.26.0, v7.28.0 or v8.5.0. Workarounds: After parsing a Set-Cookie header, validate that the resulting sameSite attribute is one of 'Strict', 'Lax', or 'None' (exact, case-insensitive) before forwarding or relying on it.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-11525 is a cookie attribute parsing vulnerability in undici (introduced in v5.15.0) where Set-Cookie SameSite validation fails to implement RFC 6265 correctly. The parser uses substring matching rather than case-insensitive exact matching, accepting non-compliant values and mapping them to standard tokens. For example, 'SameSite=StrictLax' maps to 'Lax' (a downgrade), and 'SameSite=NoneOfYourBusiness' maps to 'None' (the permissive default). Applications that parse Set-Cookie responses and forward or rely on the sameSite attribute inherit this weakened enforcement. The flaw is classified under CWE-183 (Permissive Allowlist Entry).

Business impact

Organizations using undici for HTTP clients, proxies, or fetch operations that process Set-Cookie headers face a silent degradation of cookie security policies. A malicious or misconfigured upstream server can trick applications into treating cookies with weaker SameSite settings than intended, increasing cross-site request forgery (CSRF) risk. The impact is amplified in proxy or middleware scenarios where applications relay cookies to downstream clients. Since the parsing happens silently without warnings, security assumptions baked into application logic may be violated without detection.

Affected systems

The vulnerability affects all versions of nodejs/undici from 5.15.0 through the unpatched versions in the 6, 7, and 8 release lines. Patches are available in undici v6.26.0, v7.28.0, and v8.5.0. Any application or service using an earlier version of undici that processes Set-Cookie headers—including those using undici's fetch API or proxy functionality—is vulnerable.

Exploitability

Exploitation requires a network position allowing the attacker to respond to HTTP requests as a server (either through DNS hijacking, network compromise, or control of a legitimate upstream service). The attack is deterministic; no user interaction or special conditions are required beyond the application consuming and relying on the parsed cookie. The CVSS score of 3.7 (Low) reflects that impact is limited to integrity of cookie policy enforcement rather than confidentiality or availability, and the attack requires elevated network access. However, the silent nature of the failure means exploitation may go unnoticed.

Remediation

Upgrade undici to v6.26.0, v7.28.0, or v8.5.0 depending on your active release line. Organizations unable to patch immediately should implement validation logic downstream: after undici parses a Set-Cookie header, explicitly verify that the sameSite attribute is one of 'Strict', 'Lax', or 'None' (case-insensitive exact match) before forwarding or acting on the cookie. Reject or log non-conformant values.

Patch guidance

Patched versions are undici v6.26.0, v7.28.0, and v8.5.0. Review your package.json or lock files to identify which release line you are on, then update to the corresponding patched version. Test in a staging environment before production rollout to verify compatibility with your application's HTTP handling. If you maintain a fork or vendored copy of undici, backport the relevant parser fix or apply the workaround validation.

Detection guidance

Monitor Set-Cookie headers in your HTTP traffic or logs for non-standard SameSite values (anything not exactly 'Strict', 'Lax', 'None', or absent). Check your undici version in running processes and dependencies: `npm list undici` or inspect package-lock.json. In proxy or gateway scenarios, log the parsed sameSite values undici produces and alert if they differ from the server's intent. Review application logs for CSRF-related anomalies that might indicate weakened cookie enforcement.

Why prioritize this

Although assigned a Low CVSS score due to limited impact scope (integrity of cookie policy, not confidentiality or availability), this vulnerability should be prioritized if your application relies on SameSite to mitigate CSRF or enforce cookie isolation policies. Priority is highest in gateway, proxy, or server-to-server scenarios where cookie forwarding is common, and in applications that validate security assumptions at parse time. It is lower priority for simple client-side consumers that do not relay cookies or enforce policy based on the parsed attribute.

Risk score, explained

CVSS 3.1 score of 3.7 (Low) reflects: Network attack vector (AV:N), high attack complexity due to need for network control or server position (AC:H), no privilege requirement (PR:N), no user interaction (UI:N), unchanged scope (S:U), no confidentiality impact (C:N), low integrity impact (I:L) from silent policy degradation, and no availability impact (A:N). The score appropriately penalizes the attack complexity while acknowledging the integrity risk. However, context matters: in a cookie-centric security model, even low-severity policy violations warrant prompt attention.

Frequently asked questions

Can an attacker forge a Set-Cookie header directly, or must they control the server?

They must hold a network position allowing them to inject or modify HTTP responses—controlling the upstream server, DNS, or the network path. They cannot forge headers in transit unless they can intercept and modify responses.

Does this affect cookies set by client-side JavaScript, or only server-side Set-Cookie headers?

Only server-side Set-Cookie headers processed by undici are affected. Client-side JavaScript setting cookies directly is not impacted.

What if my application doesn't use the sameSite attribute at all?

You are not directly vulnerable, but if you forward cookies to downstream clients that do rely on sameSite, you may inadvertently weaken their CSRF protections. Auditing is still recommended.

Is there a way to detect if a server is sending non-compliant SameSite values?

Yes. Implement downstream validation: after undici parses a Set-Cookie, verify the sameSite attribute against the RFC 6265 spec ('Strict', 'Lax', 'None') and reject or flag any other value before use.

This analysis is based on the CVE description and vendor guidance as of the publication date. CVSS scores and affected version ranges are sourced from official advisories and should be verified against the undici GitHub security advisory before deployment decisions. Proof-of-concept or exploit details are not included. Organizations should test patches in non-production environments before rollout. This summary does not constitute legal or compliance advice. Source: NVD (public-domain), retrieved 2026-07-27. Analysis generated by SEC.co (claude-haiku-4-5).