Description
cookies is a Node.js library for reading and writing HTTP cookies, used by Koa via ctx.cookies. In versions before 0.9.2 the library validates the cookie name and value against character sets that reject the semicolon separator, but the domain and path options are checked only against a permissive RFC 7230 field-content matcher that allows semicolons, and both are written into the Set-Cookie header unescaped. An application that passes untrusted or request-derived data into the domain or path option can therefore inject additional cookie attributes, overriding SameSite, Secure, HttpOnly, or Domain on the cookies the application issues. This is a Set-Cookie attribute injection issue (CWE-74). The issue is fixed in cookies 0.9.2, which validates domain and path against RFC 6265 character sets. As a workaround, keep domain and path application-set rather than derived from untrusted input.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| cookies | cookies | < 0.9.2 | 0.9.2 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | node-cookies | 0.9.2+~0.9.2-1 | — |
| Debian 13 | node-cookies | No fix yet | — |
| Debian 12 | node-cookies | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | node-cookies | No fix yet | — |
| Ubuntu 26.04 LTS | node-cookies | No fix yet | — |
| Ubuntu 24.04 LTS | node-cookies | No fix yet | — |
| Ubuntu 22.04 LTS | node-cookies | No fix yet | — |
| Ubuntu 20.04 LTS | node-cookies | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | node-cookies | No fix yet | — |
| Ubuntu 16.04 LTS | node-cookies | No fix yet | — |