Miggo Logo

CVE-2023-29020: CSRF token fixation in fastify-passport

6.5

CVSS Score
3.1

Basic Information

EPSS Score
0.21943%
Published
4/21/2023
Updated
11/9/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
@fastify/passportnpm< 1.1.01.1.0
@fastify/passportnpm>= 2.0.0, < 2.3.02.3.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from session persistence across authentication boundaries. The SecureSessionManager.logIn function was vulnerable because it handled user authentication without clearing existing session attributes. The commit diff shows this function was modified to add session cleanup logic (regenerating session/clearing fields) when clearSessionOnLogin is enabled. Before this fix, the absence of session cleanup allowed preservation of the _csrf value between pre-login and authenticated sessions, enabling CSRF token fixation. The direct modification of this function in the security patch confirms its role in the vulnerability.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T** [*SR*](*ttps://ow*sp.or*/www-*ommunity/*tt**ks/*sr*) prot**tion *n*or*** *y t** `@**sti*y/*sr*-prot**tion` li*r*ry, w**n *om*in** wit* `@**sti*y/p*ssport`, **n ** *yp*ss** *y n*twork *n* s*m*-sit* *tt**k*rs. ## **t*ils `**sti*y/*sr*-prot**tion`

Reasoning

T** vuln*r**ility st*ms *rom s*ssion p*rsist*n** **ross *ut**nti**tion *oun**ri*s. T** `S**ur*S*ssionM*n***r.lo*In` *un*tion w*s vuln*r**l* ****us* it **n*l** us*r *ut**nti**tion wit*out *l**rin* *xistin* s*ssion *ttri*ut*s. T** *ommit *i** s*ows t*i