{"id":"CVE-2021-29624","aliases":["CVE-2021-29624","GHSA-rc4q-9m69-gqp8"],"related":[],"kind":"vulnerability","state":"published","title":"Lack of protection against cookie tossing attacks in fastify-csrf","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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 <xhelallikaj20@gmail.com>.\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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"fastify-csrf es un plugin de código abierto que ayuda a desarrolladores a proteger su servidor Fastify contra ataques de tipo CSRF.&#xa0;Las versiones de fastify-csrf anterior a versión 3.1.0, presentan un mecanismo de \"double submit\" usando cookies con una aplicación implementada en múltiples subdominios, por ejemplo, una plataforma de estilo \"heroku\" como servicio.&#xa0;La versión 3.1.0 de fastify-csrf corrige&#xa0;la vulnerabilidad.&#xa0;El usuario del módulo necesitaría suministrar un \"userInfo\" cuando se genera el token de tipo CSRF para implementar completamente la protección en su extremo.&#xa0;Esto solo es necesario para aplicaciones alojadas en diferentes subdominios","source":"nvd"}],"published":"2021-05-17T20:53:30.000Z","modified":"2026-07-08T06:28:40.068Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-352","CWE-565"],"affected":[{"ranges":[{"version":"< 3.1.0","status":"affected"}],"vendor":"fastify","product":"fastify-csrf","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.1.0"}],"ecosystem":"npm","package":"fastify-csrf","purl":"pkg:npm/fastify-csrf","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.0"}],"vendor":"fastify","product":"fastify-csrf","cpe":"cpe:2.3:a:fastify:fastify-csrf:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/fastify/fastify-csrf/security/advisories/GHSA-rc4q-9m69-gqp8","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/fastify/csrf/pull/2","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/fastify/fastify-csrf/pull/51","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/fastify/fastify-csrf/releases/tag/v3.1.0","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29624","tags":["advisory"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-29624","url":"https://www.cve.org/CVERecord?id=CVE-2021-29624","licence":"CVE Terms of Use","modified":"2024-08-03T22:11:06.350Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rc4q-9m69-gqp8","url":"https://github.com/advisories/GHSA-rc4q-9m69-gqp8","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:40.068Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-29624","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29624","licence":"Public domain","modified":"2026-06-17T03:48:02.987Z"}],"updatedAt":"2026-11-25T22:58:01.462Z","epss":{"score":0.00829,"percentile":0.58651,"date":"2026-12-01T12:00:22.000Z"}}