Vulnerability · Published May 19, 2021 · Assigned by GitHub_M
CVE-2021-29624Lack of protection against cookie tossing attacks in fastify-csrf
Medium 6.5
In plain English
A medium-severity security flaw in fastify-csrf from fastify. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 58% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | fastify-csrf | 3.1.0 | GHSA-rc4q-9m69-gqp8 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| fastify | fastify-csrf | < 3.1.0 |
Weakness: CWE-565 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
References
- https://github.com/fastify/fastify-csrf/security/advisories/GHSA-rc4q-9m69-gqp8 x_refsource_CONFIRM
- https://github.com/fastify/csrf/pull/2 x_refsource_MISC
- https://github.com/fastify/fastify-csrf/pull/51 x_refsource_MISC
- https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html x_refsource_MISC
- https://github.com/fastify/fastify-csrf/releases/tag/v3.1.0 x_refsource_MISC
- https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf x_refsource_MISC