CVE-2024-35220
JSON

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 packageVersionsReported by
fastify session< 10.9.0, up to 10.8.0
Not affected: 10.9.0
CVE List
@fastify/session (npm)before 10.9.0GitHub Advisory Database

All scores

GitHub_M7.4high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
GitHub7.4high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

Classification

CWE-613

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

SourceRecordLicence
CVE ListCVE-2024-35220 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-pj27-2xvp-4qxg changed 2026-09-10CC-BY-4.0
NVDCVE-2024-35220 changed 2026-06-17Public domain