Cross-site Request Forgery (CSRF) Affecting @fastify/passport package, versions <1.1.0 >=2.0.0 <2.3.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.07% (32nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-FASTIFYPASSPORT-5457849
  • published 23 Apr 2023
  • disclosed 23 Apr 2023
  • credit pedromigueladao,lavish

How to fix?

Upgrade @fastify/passport to version 1.1.0, 2.3.0 or higher.

Overview

@fastify/passport is a Simple, unobtrusive authentication for Fastify.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF). CSRF protection is implemented using a synchronizer token pattern, 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.

References

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
6.5 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    High
  • Availability (A)
    None
Expand this section

NVD

6.5 medium