Hono: Cookie helper does not sanitize sameSite and priority, allowing Set-Cookie injection
Hono is a Web application framework that provides support for any JavaScript runtime. Prior to 4.12.21, the serialize() function in hono/cookie validates domain and path options against characters that corrupt Set-Cookie header syntax (;, \r, \n), but does not apply the same validation to sameSite and priority. An application that passes user-controlled input into either option may produce a Set-Cookie response header containing attacker-chosen additional attributes. This vulnerability is fixed in 4.12.21.
Problem Types
| Type | CWE ID | Description |
|---|
| CWE | CWE-113 | CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') |
| CWE | CWE-1287 | CWE-1287: Improper Validation of Specified Type of Input |
Type: CWE
Description: CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')
Type: CWE
Description: CWE-1287: Improper Validation of Specified Type of Input
Metrics
| Version | Base score | Base severity | Vector |
|---|
| 3.1 | 4.3 | MEDIUM | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N |
Version: 3.1
Base score: 4.3
Base severity: MEDIUM
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N