6.5

CVE-2023-27495: fastify csrf-protection Cross-Site Request Forgery (CSRF)

CVSS: 6.5v3.1MediumModified
AliasesGHSA-qrgf-9gpc-vrxw
Published 20-04-2023Last modified 05-02-2025

Vulnerability summary

CVE-2023-27495 is a medium (CVSS 6.5) Cross-Site Request Forgery (CSRF) vulnerability in fastify csrf-protection. EPSS estimates a 0.33% chance of exploitation in the next 30 days, higher than 24.8% of scored vulnerabilities.

Overall risk
26/100
0100
Medium · default modelHow is this calculated?
CVSS score
6.5/10
010
Medium · v3.1 (NVD)
EPSS score
0.33%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Timeline

  1. 20-04-2023
    PublishedVulnerability first disclosed.
  2. 05-02-2025
    Last modifiedVulnerability information updated.

Description

@fastify/csrf-protection is a plugin which helps protect Fastify servers against CSRF attacks. The CSRF protection enforced by the @fastify/csrf-protection library in combination with @fastify/cookie can be bypassed from network and same-site attackers under certain conditions. @fastify/csrf-protection supports an optional userInfo parameter that binds the CSRF token to the user. This parameter has been introduced to prevent cookie-tossing attacks as a fix for CVE-2021-29624. Whenever userInfo parameter is missing, or its value can be predicted for the target user account, network and same-site attackers can 1. fixate a _csrf cookie in the victim's browser, and 2. forge CSRF tokens that are valid for the victim's session. This allows attackers to bypass the CSRF protection mechanism. As a fix, @fastify/csrf-protection starting from version 6.3.0 (and v4.1.0) includes a server-defined secret hmacKey that cryptographically binds the CSRF token to the value of the _csrf cookie and the userInfo parameter, making tokens non-spoofable by attackers. This protection is effective as long as the userInfo parameter is unique for each user. This is patched in versions 6.3.0 and v4.1.0. Users are advised to upgrade. Users unable to upgrade may use a random, non-predictable userInfo parameter for each user as a mitigation.

CVSS metrics

3 scores · 3 sources · 1 version

EPSS trend

Probability

0.33%

Chance of exploitation in the next 30 days

Percentile

25%

Versus all other CVEs

30-day change

0.00 pp

From 0.33% on 20-09-2026

20-09-202620-10-2026
EPSS score
0.33%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

@fastify1 product
  • csrf-protection< 4.1.0 | ≥ 5.0.0, < 6.3.0
Fastify1 product

2 vendors · 2 products

References

8 links