# CVE-2024-35220: @fastify/session reuses destroyed session cookie

- Severity: High 7.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.45%, higher than 40% of CVEs (2026-12-01)
- Published: 2024-05-21T18:09:57.000Z
- Modified: 2026-09-10T03:50:14.089Z
- Also known as: GHSA-pj27-2xvp-4qxg
- Weaknesses: CWE-613
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- fastify session: < 10.9.0; up to 10.8.0 (not affected: 10.9.0)
- @fastify/session (npm): before 10.9.0

## Every score

- GitHub_M: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N`
- GitHub: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N`

## References

- <https://github.com/fastify/session/security/advisories/GHSA-pj27-2xvp-4qxg> (web)
- <https://github.com/fastify/session/issues/251> (web)
- <https://github.com/fastify/session/commit/0495ce5b534c4550f25228821db8098293439f2f> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-35220> (advisory)
- <https://github.com/fastify/session> (package)

## Sources

- CVE List: [CVE-2024-35220](https://www.cve.org/CVERecord?id=CVE-2024-35220), CVE Terms of Use, modified 2024-08-02
- GitHub Advisory Database: [GHSA-pj27-2xvp-4qxg](https://github.com/advisories/GHSA-pj27-2xvp-4qxg), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-35220](https://nvd.nist.gov/vuln/detail/CVE-2024-35220), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-35220 · Whole record: https://cve.day/CVE-2024-35220.json · Rebuilt by cve.day 2026-11-25T22:58:40.703Z
