CyberRota Analysis
AI-GeneratedThe Node.js cookies library, used by Koa, is vulnerable in versions prior to 0.9.2 due to improper validation of the domain and path options, allowing attackers to inject additional attributes into the Set-Cookie header. This could lead to the overriding of critical security attributes like SameSite, Secure, and HttpOnly, potentially compromising session security. Developers and organizations utilizing affected versions should prioritize upgrading to 0.9.2 or later to mitigate this risk, especially those handling untrusted input in cookie settings.
Public Exploit Signal
A public exploit, PoC, GitHub repository or Metasploit reference was detected for this CVE.
Note: these links are listed for security research and verification purposes only.
Original NVD 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.