PT-2023-22091 · Unknown · @Fastify/Passport+1
Pedromigueladao
·
Published
2023-04-21
·
Updated
2023-05-04
·
CVE-2023-29019
CVSS v3.1
8.1
High
| Vector | AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
Name of the Vulnerable Software and Affected Versions
@fastify/passport versions prior to the version that regenerates sessionId upon login
Description
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. 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.
Recommendations
As a solution, upgrade to a newer version of @fastify/passport that regenerates sessionId upon login, preventing the attacker-controlled pre-session cookie from being upgraded to an authenticated session.
For versions prior to the fixed version, consider disabling the authenticate function until a patch is available, or restrict access to the @fastify/session module to minimize the risk of exploitation.
Exploit
Fix
Session Fixation
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
@Fastify/Passport
@Fastify/Session