CVE-2023-29020
JavaScript vulnerability analysis and mitigation

Overview

The CVE-2023-29020 vulnerability affects @fastify/passport, a port of the passport authentication library for the Fastify ecosystem. This vulnerability was disclosed on April 21, 2023, and impacts versions <= 1.0.1 and 2.0.0 <= 2.2.0. The issue allows CSRF (Cross-Site Request Forgery) protection to be bypassed when @fastify/passport is used in combination with @fastify/csrf-protection (GitHub Advisory).

Technical details

The vulnerability stems from how @fastify/csrf-protection implements the synchronizer token pattern using @fastify/session and @fastify/secure-session plugins. The implementation stores a random value for CSRF token generation in the csrf attribute of a user's session. The critical flaw occurs because @fastify/passport does not clear the session object upon authentication, which results in the csrf attribute being preserved between pre-login and authenticated sessions. The vulnerability has been assigned a CVSS v3.1 base score of 6.5 (Medium) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N (GitHub Advisory).

Impact

Network and same-site attackers can exploit this vulnerability by obtaining a CSRF token for their pre-session, fixating that pre-session in the victim's browser via cookie tossing, and then performing a CSRF attack after the victim authenticates. This allows attackers to perform unauthorized actions on behalf of authenticated users (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions >= 1.1.0 < 2.0.0 and >= 2.3.0. The fix introduces two new configuration options: clearSessionOnLogin (default: true) and clearSessionIgnoreFields (default: ['passport', 'session']) to clear all session attributes by default, while preserving those explicitly defined in clearSessionIgnoreFields (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66456CRITICAL9.1
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-66457HIGH7.5
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-65849MEDIUM6.9
  • JavaScriptJavaScript
  • altcha
NoNoDec 08, 2025
CVE-2025-66202MEDIUM6.5
  • JavaScriptJavaScript
  • astro
NoYesDec 09, 2025
CVE-2025-66479LOW1.8
  • JavaScriptJavaScript
  • @anthropic-ai/sandbox-runtime
NoYesDec 04, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management