LiveActive security incident?Get immediate response
CVE Record

CVE-2021-29624: Lack of protection against cookie tossing attacks in fastify-csrf

fastify-csrf is an open-source plugin helps developers protect their Fastify server against CSRF attacks. Versions of fastify-csrf prior to 3.1.0 have a "double submit" mechanism using cookies with an application deployed across multiple subdomains, e.g. "heroku"-style platform as a service. Version 3.1.0 of the fastify-csrf fixes it. the vulnerability. The user of the module would need to supply a `userInfo` when generating the CSRF token to fully implement the protection on their end. This is needed only for applications hosted on different subdomains.

MediumCVSS 6.5Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

CVE-2021-29624 affects fastify-csrf before 3.1.0. In multi-subdomain deployments, its cookie-based CSRF protection could be weakened by cookie tossing, potentially allowing unauthorized state-changing actions if a victim interacts with an attacker-controlled flow.

Executive priority

Treat this as a targeted integrity risk, not a broad emergency. Prioritize internet-facing authenticated Fastify applications using fastify-csrf on multi-subdomain infrastructure, especially where account, payment, admin, or profile changes are protected by CSRF tokens.

Technical view

The issue is CWE-565 in fastify-csrf's double-submit cookie design. For applications spread across subdomains, the CSRF token was not sufficiently bound to user-specific information. Version 3.1.0 adds support requiring users to pass userInfo when generating tokens for full protection.

Likely exposure

Exposure is most likely in Fastify applications using fastify-csrf versions below 3.1.0 and deployed across multiple subdomains or shared subdomain-style platforms. Single-domain deployments appear less directly affected based on the advisory text.

Exploitation context

The provided sources do not show CISA KEV listing or confirmed active exploitation. Attack feasibility depends on multi-subdomain hosting, cookie behavior, and user interaction, consistent with CVSS UI:R and high integrity impact.

Researcher notes

The key validation point is whether the application used vulnerable fastify-csrf versions and multi-subdomain cookie scope. The source bundle names the fixed version and implementation requirement, but does not provide evidence of exploitation in the wild.

Mitigation direction

  • Upgrade fastify-csrf to version 3.1.0 or later.
  • Pass userInfo when generating CSRF tokens for multi-subdomain applications.
  • Review vendor advisory and release notes before deployment.
  • Review OWASP CSRF guidance for double-submit cookie designs.
  • Prioritize applications with authenticated state-changing actions.

Validation and detection

  • Check package manifests and lockfiles for fastify-csrf versions below 3.1.0.
  • Identify deployments using multiple subdomains or shared subdomain-style hosting.
  • Review token generation code for required userInfo usage.
  • Confirm CSRF protections still pass normal user workflows after upgrade.
  • Verify no bundled or transitive legacy copy remains deployed.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-565: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Credential and access behavior lookup

The CVE wording references authentication or credential exposure, so valid-account and credential-access review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-29624 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
6.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
7Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
6.5CVSS 3.1MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N2.83.6Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

6.5Medium
CVSS 3.1 vector shape for CVE-2021-29624Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
fastifyfastify-csrf< 3.1.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-565 · source CWE mapping

Reliance on Cookies without Validation and Integrity Checking

Reliance on Cookies without Validation and Integrity Checking represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.