7.4high
@fastify/session reuses destroyed session cookie
- Severity
- 7.4high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.45% (higher than 40% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-pj27-2xvp-4qxg
Description
@fastify/session is a session plugin for fastify. Requires the @fastify/cookie plugin. When restoring the cookie from the session store, the `expires` field is overriden if the `maxAge` field was set. This means a cookie is never correctly detected as expired and thus expired sessions are not destroyed. This vulnerability has been patched 10.8.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| fastify session | < 10.9.0, up to 10.8.0 Not affected: 10.9.0 | CVE List |
| @fastify/session (npm) | before 10.9.0 | GitHub Advisory Database |
All scores
| GitHub_M | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
| GitHub | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
@fastify/session is a session plugin for fastify. Requires the @fastify/cookie plugin. When restoring the cookie from the session store, the `expires` field is overriden if the `maxAge` field was set. This means a cookie is never correctly detected as expired and thus expired sessions are not destroyed. This vulnerability has been patched 10.8.0.
GitHub Advisory Database
Impact
When restoring the cookie from the session store, the expires field is overriden if the maxAge field was set.
This means a cookie is never correctly detected as expired and thus expired sessions are not destroyed.
Patches
Updating to v10.9.0 will solve this.
Workarounds
None
References
Publicly reported at: https://github.com/fastify/session/issues/251
NVD (es)
@fastify/session es un complemento de sesión para fastify. Requiere el complemento @fastify/cookie. Al restaurar la cookie desde el almacén de sesiones, el campo "expires" se anula si se configuró el campo "maxAge". Esto significa que una cookie nunca se detecta correctamente como caducada y, por lo tanto, las sesiones caducadas no se destruyen. Esta vulnerabilidad ha sido parcheada 10.8.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-35220 changed 2024-08-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pj27-2xvp-4qxg changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-35220 changed 2026-06-17 | Public domain |