6.5
MEDIUM
CVE-2023-27495
Fastify CSRF Protection Token Bypass
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.

INFO

Published Date :

April 20, 2023, 6:15 p.m.

Last Modified :

May 2, 2023, 2:07 a.m.

Remotely Exploitable :

Yes !

Impact Score :

3.6

Exploitability Score :

2.8
Affected Products

The following products are affected by CVE-2023-27495 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Fastify csrf-protection
References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2023-27495.

URL Resource
https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058 Patch
https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw Vendor Advisory
https://www.cvedetails.com/cve/CVE-2021-29624 Third Party Advisory

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2023-27495 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2023-27495 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • Initial Analysis by [email protected]

    May. 02, 2023

    Action Type Old Value New Value
    Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
    Changed Reference Type https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058 No Types Assigned https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058 Patch
    Changed Reference Type https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw No Types Assigned https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw Vendor Advisory
    Changed Reference Type https://www.cvedetails.com/cve/CVE-2021-29624 No Types Assigned https://www.cvedetails.com/cve/CVE-2021-29624 Third Party Advisory
    Added CPE Configuration OR *cpe:2.3:a:fastify:csrf-protection:*:*:*:*:*:node.js:*:* versions up to (excluding) 4.1.0 *cpe:2.3:a:fastify:csrf-protection:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (excluding) 6.3.0
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2023-27495 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2023-27495 weaknesses.

Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

0.09 }} 0.00%

score

0.38681

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability