Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS00bTNtLXBwdngteGd3Oc4AAy6_

Session fixation in fastify-passport

Applications using @fastify/passport 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.

Details

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.

Fix

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.

Credits

Permalink: https://github.com/advisories/GHSA-4m3m-ppvx-xgw9
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS00bTNtLXBwdngteGd3Oc4AAy6_
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 1 year ago
Updated: 6 months ago


CVSS Score: 8.1
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Identifiers: GHSA-4m3m-ppvx-xgw9, CVE-2023-29019
References: Repository: https://github.com/fastify/fastify-passport
Blast Radius: 10.5

Affected Packages

npm:@fastify/passport
Dependent packages: 8
Dependent repositories: 20
Downloads: 54,873 last month
Affected Version Ranges: >= 2.0.0, < 2.3.0, < 1.1.0
Fixed in: 2.3.0, 1.1.0
All affected versions: 1.0.0, 1.0.1, 2.0.0, 2.0.1, 2.1.0, 2.2.0
All unaffected versions: 1.1.0, 2.3.0, 2.4.0