6.5

CVE-2023-29020: Cross site request forgery token fixation in fastify-passport

Modified
AliasesGHSA-2ccf-ffrj-m4qw
Published 21-04-2023Last modified 04-02-2025

Vulnerability summary

CVE-2023-29020 is a medium (CVSS 6.5) Cross-Site Request Forgery vulnerability in fastify fastify-passport. EPSS estimates a 0.38% chance of exploitation in the next 30 days, higher than 34.5% of scored vulnerabilities.

Priority
Routine

Not severe (CVSS 6.5, network access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
6.5/10
010
Medium · v3.1 (CVE.org)
EPSS score
0.38%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Timeline

  1. 21-04-2023
    PublishedVulnerability first disclosed.
  2. 04-02-2025
    Last modifiedVulnerability information updated.

Description

@fastify/passport is a port of passport authentication library for the Fastify ecosystem. The CSRF (Cross-Site Request Forger) protection enforced by the `@fastify/csrf-protection` library, when combined with `@fastify/passport` in affected versions, can be bypassed by network and same-site attackers. `fastify/csrf-protection` implements the synchronizer token pattern (using plugins `@fastify/session` and `@fastify/secure-session`) by storing a random value used for CSRF token generation in the `_csrf` attribute of a user's session. The `@fastify/passport` library does not clear the session object upon authentication, preserving the `_csrf` attribute between pre-login and authenticated sessions. Consequently, CSRF tokens generated before authentication are still valid. Network and same-site attackers can thus obtain a CSRF token for their pre-session, fixate that pre-session in the victim's browser via cookie tossing, and then perform a CSRF attack after the victim authenticates. As a solution, newer versions of `@fastify/passport` include the configuration options: `clearSessionOnLogin (default: true)` and `clearSessionIgnoreFields (default: ['passport', 'session'])` to clear all the session attributes by default, preserving those explicitly defined in `clearSessionIgnoreFields`.

CVSS metrics

3 scores · 3 sources · 1 version

EPSS trend

Probability

0.38%

Chance of exploitation in the next 30 days

Percentile

35%

Versus all other CVEs

30-day change

No change 0.00 pp

From 0.38% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.

Fastify2 products
@fastify1 product
  • passport< 1.1.0 | ≥ 2.0.0, < 2.3.0

2 vendors · 3 products

References

6 links