CVE-2023-29020 in Fastify Passport
@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-...
Affects 1 product from 1 vendor. Facts below cite their sources.
Remotely exploitable over the network, low complexity, no authentication required, requires user interaction, impact contained to the vulnerable component, no confidentiality impact, full integrity impact, no availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Fastify | Passport | < 1.1.0 ≥ 2.0.0, < 2.3.0 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
No official vendor advisory link on record. See the CVE record.
Vendor PSIRT: [email protected]
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official 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`.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2023-29020 |
|---|---|
| BreachSpider ID | BS-2023-GLOBAL-350208-M |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| Published | 2023-04-21 |
| Last modified | 2026-06-17 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-352: Cross-Site Request Forgery (CSRF)
Web application does not verify that a request was intentionally sent by the authenticated user.
CWE-384: CWE-384
Related attack patterns (CAPEC)
CAPEC-31 Accessing/Intercepting/Modifying HTTP Cookies via CWE-384
CAPEC-59 Session Credential Falsification through Prediction via CWE-384
CAPEC-60 Reusing Session IDs (aka Session Replay) via CWE-384
CAPEC-61 Session Fixation via CWE-384
CAPEC-462 Cross-Domain Search Timing via CWE-352
Show all 11
CAPEC-467 Cross Site Identification via CWE-352
CAPEC-39 Manipulating Opaque Client-based Data Tokens via CWE-384
CAPEC-62 Cross Site Request Forgery via CWE-352
CAPEC-111 JSON Hijacking (aka JavaScript Hijacking) via CWE-352
CAPEC-196 Session Credential Falsification through Forging via CWE-384
CAPEC-21 Exploitation of Trusted Identifiers via CWE-384
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
A vulnerability in the @fastify/passport library, when used in conjunction with @fastify/csrf-protection, allows attackers to bypass CSRF protection mechanisms, potentially leading to unauthorized actions being performed on behalf of authenticated users.
Network and same-site attackers can exploit this vulnerability by manipulating the synchronizer token pattern implemented by @fastify/csrf-protection. This can lead to CSRF attacks where an attacker tricks a user into performing actions without their knowledge or consent.
Questions
What is CVE-2023-29020?
A vulnerability in the @fastify/passport library, when used in conjunction with @fastify/csrf-protection, allows attackers to bypass CSRF protection mechanisms, potentially leading to unauthorized actions being performed on behalf of authenticated users.
What is the CVSS score for CVE-2023-29020?
CVE-2023-29020 has CVSS 6.5 (Medium). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N. EPSS: 0.4%.
Is CVE-2023-29020 actively exploited?
No confirmed active exploitation of CVE-2023-29020 as of 2026-09-25.
How do I remediate CVE-2023-29020?
Priority: HIGH. PSIRT: [email protected]
What systems are affected by CVE-2023-29020?
CVE-2023-29020 affects Fastify Passport.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Fastify","product":"Passport","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.