{"id":"GHSA-rc4q-9m69-gqp8","summary":"Lack of protection against cookie tossing attacks in fastify-csrf","details":"### Impact\n\nUsers 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. \n\n### Patches\n\nVersion 3.1.0 of the fastify-csrf fixes it. \nSee https://github.com/fastify/fastify-csrf/pull/51 and https://github.com/fastify/csrf/pull/2.\n\nThe 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.\n\n### Workarounds\n\nNone available.\n\n### References\n\n1. https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html\n2. https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf\n\n### Credits\n\nThis vulnerability was found by Xhelal Likaj \u003cxhelallikaj20@gmail.com\u003e.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [fastify-csrf](https://github.com/fastify/fastify-csrf)\n* Email us at [hello@matteocollina.com](mailto:hello@matteocollina.com)\n","aliases":["CVE-2021-29624"],"modified":"2026-07-08T06:28:40.068593532Z","published":"2021-05-17T20:53:30Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2021-05-17T20:29:48Z","nvd_published_at":"2021-05-19T22:15:00Z","cwe_ids":["CWE-352","CWE-565"],"severity":"MODERATE"},"references":[{"type":"WEB","url":"https://github.com/fastify/fastify-csrf/security/advisories/GHSA-rc4q-9m69-gqp8"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29624"},{"type":"WEB","url":"https://github.com/fastify/csrf/pull/2"},{"type":"WEB","url":"https://github.com/fastify/fastify-csrf/pull/51"},{"type":"WEB","url":"https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html"},{"type":"WEB","url":"https://github.com/fastify/fastify-csrf/releases/tag/v3.1.0"},{"type":"WEB","url":"https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf"}],"affected":[{"package":{"name":"fastify-csrf","ecosystem":"npm","purl":"pkg:npm/fastify-csrf"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.1.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/05/GHSA-rc4q-9m69-gqp8/GHSA-rc4q-9m69-gqp8.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"}]}