CVE-2023-29019 Session fixation in fastify-passport

High 8.1 Published Updated

Attackers can hijack user sessions by fixing the session ID before login, allowing account takeover in applications using fastify-passport.

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-2023-29019?

CVE-2023-29019 is a high-severity authentication bypass vulnerability in fastify-passport, published on 21 Apr 2023. 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/passport is a port of passport authentication library for the Fastify ecosystem. Applications using `@fastify/passport` in affected versions for user authentication, in combination with `@fastify/session` as the underlying session management mechanism, are vulnerable to session fixation attacks from network and same-site attackers. fastify applications rely on the `@fastify/passport` library for user authentication. The login and user validation are performed by the `authenticate` function. When executing this function, the `sessionId` is preserved between the pre-login and the authenticated session. Network and same-site attackers can hijack the victim's session by tossing a valid `sessionId` cookie in the victim's browser and waiting for the victim to log in on the website. As a solution, newer versions of `@fastify/passport` regenerate `sessionId` upon login, preventing the attacker-controlled pre-session cookie from being upgraded to an authenticated session. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-384

Which versions are affected by CVE-2023-29019?

4 open source packages ship an affected version, including @fastify/passport. It affects 1 product.

PackageAffectedFixed in
@fastify/passport npmAll versions1.1.0
@fastify/passport npmAll versions1.1.0
@fastify/passport npmFrom 2.0.02.3.0
@fastify/passport npmFrom 2.0.02.3.0

Products include Fastify Passport.

How do I fix CVE-2023-29019?

Upgrade @fastify/passport to a fixed version for your release line: 1.1.0 or 2.3.0.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2023-29019 being exploited?

There is no known exploitation of CVE-2023-29019 in the wild and no public exploit code.

Sources

Also known as GHSA-4m3m-ppvx-xgw9.

Is CVE-2023-29019 in your software?

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

Check your SBOMs for free