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

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.83%, higher than 58% of CVEs (2026-12-01)
- Published: 2021-05-17T20:53:30.000Z
- Modified: 2026-07-08T06:28:40.068Z
- Also known as: GHSA-rc4q-9m69-gqp8
- Weaknesses: CWE-352, CWE-565
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- fastify fastify-csrf: < 3.1.0; before 3.1.0
- fastify-csrf (npm): before 3.1.0

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://github.com/fastify/fastify-csrf/security/advisories/GHSA-rc4q-9m69-gqp8> (patch, third-party-advisory, web)
- <https://github.com/fastify/csrf/pull/2> (patch, third-party-advisory, web)
- <https://github.com/fastify/fastify-csrf/pull/51> (patch, third-party-advisory, web)
- <https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html> (third-party-advisory, web)
- <https://github.com/fastify/fastify-csrf/releases/tag/v3.1.0> (third-party-advisory, web)
- <https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-29624> (advisory)

## Sources

- CVE List: [CVE-2021-29624](https://www.cve.org/CVERecord?id=CVE-2021-29624), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-rc4q-9m69-gqp8](https://github.com/advisories/GHSA-rc4q-9m69-gqp8), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-29624](https://nvd.nist.gov/vuln/detail/CVE-2021-29624), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-29624 · Whole record: https://cve.day/CVE-2021-29624.json · Rebuilt by cve.day 2026-11-25T22:58:01.462Z
