{"id":"CVE-2026-47675","aliases":["CVE-2026-47675","GHSA-3hrh-pfw6-9m5x"],"related":[],"kind":"vulnerability","state":"published","title":"Hono: Cookie helper does not sanitize sameSite and priority, allowing Set-Cookie injection","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe `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.\n\n### Details\n\nWhen constructing a `Set-Cookie` header value, `serialize()` appends the `sameSite` and `priority` option values directly into the output string after a presentation-only transformation (capitalizing the first character). Although the TypeScript type signature constrains these options to specific string literals, that constraint is not enforced at runtime; any string value, including one containing `;` or line-feed characters, passes through unchanged.\n\nThe validation guard that rejects `;`, `\\r`, and `\\n` from `domain` and `path` is not applied to `sameSite` or `priority`. An application that passes a request-derived value to either option therefore provides an injection point into the header line.\n\nThis issue arises when an application passes user-controlled input to the `sameSite` or `priority` option of `setCookie()` or `serialize()`.\n\n### Impact\n\nAn attacker who can control the `sameSite` or `priority` option value may inject additional attributes into a `Set-Cookie` response header.\n\nThis may lead to:\n\n- Cookie attribute injection — overriding `Domain`, `Path`, `HttpOnly`, `Secure`, or `Max-Age` for the affected cookie\n- HTTP response header injection on runtimes that do not strictly validate header values, enabling a second attacker-controlled `Set-Cookie` header in the same response\n\nThis issue affects applications that pass user-derived input into the `sameSite` or `priority` option of `hono/cookie` serialization functions.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Hono es un framework de aplicación web que proporciona soporte para cualquier tiempo de ejecución de JavaScript. Anteriormente a la 4.12.21, la función serialize() en hono/cookie valida las opciones de dominio y ruta contra caracteres que corrompen la sintaxis del encabezado Set-Cookie (;, \\r, \\n), pero no aplica la misma validación a sameSite y priority. Una aplicación que pasa entrada controlada por el usuario a cualquiera de las opciones puede producir un encabezado de respuesta Set-Cookie que contiene atributos adicionales elegidos por el atacante. Esta vulnerabilidad se corrige en la 4.12.21.","source":"nvd"}],"published":"2026-05-28T15:28:23.458Z","modified":"2026-10-14T20:10:00.190Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-113","CWE-1287"],"affected":[{"ranges":[{"version":"< 4.12.21","status":"affected"}],"vendor":"honojs","product":"hono","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.12.21"}],"ecosystem":"npm","package":"hono","purl":"pkg:npm/hono","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.12.21"}],"vendor":"hono","product":"hono","cpe":"cpe:2.3:a:hono:hono:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/honojs/hono/security/advisories/GHSA-3hrh-pfw6-9m5x","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47675","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/honojs/hono/commit/905aedbc20661e0e2fa378783a7ec44a5c3df43d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/honojs/hono","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/honojs/hono/releases/tag/v4.12.21","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-05-28T19:16:42.834Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47675","url":"https://www.cve.org/CVERecord?id=CVE-2026-47675","licence":"CVE Terms of Use","modified":"2026-05-28T19:17:17.728Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3hrh-pfw6-9m5x","url":"https://github.com/advisories/GHSA-3hrh-pfw6-9m5x","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:55.293Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47675","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47675","licence":"Public domain","modified":"2026-10-14T20:10:00.190Z"}],"updatedAt":"2026-11-25T22:59:22.967Z","epss":{"score":0.00279,"percentile":0.12977,"date":"2026-11-30T12:00:22.000Z"}}