Lack of protection against cookie tossing attacks in fastify-csrf
Impact
Users that used fastify-csrf with the "double submit" mechanism using cookies with an application deployed across multiple subdomains, e.g. "heroku"-style platform as a service.
Patches
Version 3.1.0 of the fastify-csrf fixes it. See https://github.com/fastify/fastify-csrf/pull/51 and https://github.com/fastify/csrf/pull/2.
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.
Workarounds
None available.
References
- https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html
- https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf
Credits
This vulnerability was found by Xhelal Likaj xhelallikaj20@gmail.com.
For more information
If you have any questions or comments about this advisory:
- Open an issue in fastify-csrf
- Email us at hello@matteocollina.com
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | fastify-csrf | < 3.1.0 | 3.1.0 |
Verweise
- https://github.com/fastify/fastify-csrf/security/advisories/GHSA-rc4q-9m69-gqp8
- https://nvd.nist.gov/vuln/detail/CVE-2021-29624
- https://github.com/fastify/csrf/pull/2
- https://github.com/fastify/fastify-csrf/pull/51
- https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html
- https://github.com/fastify/fastify-csrf/releases/tag/v3.1.0
- https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf
- CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N- Schwäche (CWE)
CWE-352, CWE-565- Plattform
- npm
- Paket
fastify-csrf- Veröffentlicht
- 17.05.2021
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-rc4q-9m69-gqp8 - CC BY 4.0
Schwachstellenhistorie: fastify-csrf
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 2
- Erste → letzte
- 01.2021 05.2021
- Ohne Fix
- 0
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Hoch 1
- Mittel 1
Veröffentlichungen pro Jahr
- 2021: 2
- 2022: 0
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 0
-
Lack of protection against cookie tossing attacks in fastify-csrf dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.