6.5

CVE-2023-29020: fastify fastify-passport Cross-Site Request Forgery (CSRF)

CVSS: 6.5v3.1MediumModified
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 (CSRF) vulnerability in fastify fastify-passport. EPSS estimates a 0.38% chance of exploitation in the next 30 days, higher than 30.9% of scored vulnerabilities.

Overall risk
26/100
0100
Medium · default modelHow is this calculated?
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 listedIn no KEV catalog
RansomwareNone recordedNo known 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

31%

Versus all other CVEs

30-day change

0.00 pp

From 0.38% on 20-09-2026

20-09-202620-10-2026
EPSS score
0.38%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

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

2 vendors · 3 products

References

6 links