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

High 7.4 Published Updated

Attackers can reuse expired session cookies because the plugin fails to correctly detect expiration, bypassing session termination controls.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-35220?

CVE-2024-35220 is a high-severity vulnerability in fastify session, published on 21 May 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

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

Weakness: CWE-613

Which versions are affected by CVE-2024-35220?

2 open source packages ship an affected version, including @fastify/session.

PackageAffectedFixed in
@fastify/session npmAll versions10.9.0
@fastify/session npmAll versions10.9.0

How do I fix CVE-2024-35220?

Upgrade @fastify/session to 10.9.0 or later.

Is CVE-2024-35220 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-35220 exists.

Sources

Also known as GHSA-pj27-2xvp-4qxg.

Is CVE-2024-35220 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free