GHSA-chp3-j5qr-2vfr

Suggest an improvement
Source
https://github.com/advisories/GHSA-chp3-j5qr-2vfr
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-chp3-j5qr-2vfr/GHSA-chp3-j5qr-2vfr.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-chp3-j5qr-2vfr
Aliases
Published
2026-11-10T15:57:32Z
Modified
2026-11-10T16:15:04Z
Severity
  • 6.3 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N CVSS Calculator
Summary
Effect: Cookie attribute injection via domain, path, and name fields in @effect/platform makeCookie()
Details

Impact

The name, domain, and path fields of makeCookie() were validated with a regex that allows ;, the attribute separator in Set-Cookie headers. Because serializeCookie() writes those fields verbatim, a caller who passes untrusted input into any of them can append arbitrary attributes to the header.

For example, a domain of "legit.com; Domain=.parent.tld" serializes to session=token; Domain=legit.com; Domain=.parent.tld. RFC 6265 ยง5.3 takes the last occurrence, so the injected domain wins and the cookie widens to the parent domain. The same trick sets SameSite=None or Max-Age when the caller has not set those options itself.

The value field is unaffected: it passes through encodeURIComponent, which encodes ;. CR and LF are rejected by the existing regex, so header splitting is not possible.

Patches

Fixed in #6763 (v4) and #6765 (v3): the shared regex is split into per-field validators that reject ;, and serializeCookie() now validates before writing the header.

Workarounds

Do not pass user input into name, domain, or path; set them from application constants.

Database specific
{
    "cwe_ids": [
        "CWE-20",
        "CWE-74"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-10T15:57:32Z",
    "nvd_published_at": "2026-11-03T21:17:02Z",
    "severity": "MODERATE"
}
References

Affected packages

npm / @effect/platform

Package

Name
@effect/platform
View open source insights on deps.dev
Purl
pkg:npm/%40effect/platform

Affected ranges

Type
SEMVER
Events
Introduced
0.1.0
Fixed
0.97.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-chp3-j5qr-2vfr/GHSA-chp3-j5qr-2vfr.json"

npm / effect

Package

Affected ranges

Type
SEMVER
Events
Introduced
4.0.0-beta.0
Fixed
4.0.0-beta.103

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-chp3-j5qr-2vfr/GHSA-chp3-j5qr-2vfr.json"