Lack of protection against cookie tossing attacks in fastify-csrf
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Tampering
- Confidentiality · integrity · availability
- None · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-352.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| fastify | fastify-csrf | before 3.1.0 | 3.1.0 | Patch available | CNA |
| — | fastify-csrf (npm) | before 3.1.0 | 3.1.0 | Patch available | GHSA-rc4q-9m69-gqp8 |
- fastify-csrf Vendorfastify Affected before 3.1.0 Fixed in 3.1.0 Patch available CNA
- fastify-csrf (npm) Vendor— Affected before 3.1.0 Fixed in 3.1.0 Patch available GHSA-rc4q-9m69-gqp8
Remediation
- Fix · CNA fastify-csrf (fastify) Fixed in 3.1.0
- Fix · GHSA-rc4q-9m69-gqp8 fastify-csrf (npm) Fixed in 3.1.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-29624
- 2026-10-03 Alias added: GHSA-rc4q-9m69-gqp8
References
Patch 3
Advisory 4
More Fastify-csrf vulnerabilities
- TI-2020-17292 Cross-site request forgery (CSRF) in fastify-csrf CVSS 3.1HIGH 8.8
Sources
- CVE-2021-29624 · CVE Program
- CVE-2021-29624 · NVD
- FIRST EPSS
- GHSA-rc4q-9m69-gqp8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences