Cross-site Request Forgery (CSRF) Affecting fastify-csrf package, versions <3.0.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.21% (60th 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-FASTIFYCSRF-1062044
  • published 19 Jan 2021
  • disclosed 19 Jan 2021
  • credit Xhelal Likaj

How to fix?

Upgrade fastify-csrf to version 3.0.0 or higher.

Overview

fastify-csrf is an A plugin for adding CSRF protection to Fastify.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF). The generated cookie used insecure defaults, and did not have the httpOnly flag on: cookieOpts: { path: '/', sameSite: true }. Also, the CSRF token was available in the GET query parameter

References

CVSS Scores

version 3.1
Expand this section

Snyk

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

NVD

8.8 high