{"schemaVersion":4,"id":"CVE-2021-29624","aliases":["GHSA-rc4q-9m69-gqp8"],"status":"published","duplicateOf":null,"title":"Lack of protection against cookie tossing attacks in fastify-csrf","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.","dates":{"published":"2021-05-19T21:15:28.000Z","modified":"2024-08-03T22:11:06.350Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":6.5,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":6.5,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Npm","score":6.5,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","exploitability":7.2,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":6.5,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":4.3,"severity":"medium","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00829,"percentile":0.58819,"severity":"low","asOf":"2026-12-04T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-11-04T00:00:00.000Z","baselineScore":0.00829},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-22T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-23T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-24T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-25T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-26T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-27T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-28T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-29T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-30T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-10-31T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-01T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-02T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-03T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-04T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00829,"percentile":0.58819}],"last30":[{"date":"2026-11-04T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00829,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00829,"percentile":0.58819}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-565","name":"Reliance on Cookies without Validation and Integrity Checking","description":"The product relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.","type":"weakness","status":"Incomplete","abstraction":"Base","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/565.html"},{"id":"CWE-352","name":"Cross-Site Request Forgery","description":"The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.","type":"weakness","status":"Stable","abstraction":"Compound","likelihoodOfExploit":"Medium","url":"https://cwe.mitre.org/data/definitions/352.html"}],"affected":[{"vendor":"fastify","product":"fastify-csrf","name":"fastify-csrf","label":"fastify-csrf","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 3.1.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"3.1.0","endInclusive":false}}],"versionsText":"< 3.1.0","eol":null,"hubHref":"/vendor/fastify/fastify-csrf"},{"vendor":"Npm","product":"fastify-csrf","name":"fastify-csrf","label":"fastify-csrf","ecosystem":"Npm","cpePart":null,"purl":"pkg:npm/fastify-csrf","purlType":"npm","versions":[{"text":"< 3.1.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"3.1.0","endInclusive":false}}],"versionsText":"< 3.1.0","eol":null,"hubHref":null}],"affectedCount":2,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/fastify/fastify-csrf/security/advisories/GHSA-rc4q-9m69-gqp8","label":"github.com/fastify/fastify-csrf/security/advisories/GHSA-rc4q-9m69-gqp8","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Patch","Third Party Advisory"]},{"url":"https://github.com/fastify/csrf/pull/2","label":"github.com/fastify/csrf/pull/2","hostname":"github.com","tags":["X Refsource MISC","WEB","Patch","Third Party Advisory"]},{"url":"https://github.com/fastify/fastify-csrf/pull/51","label":"github.com/fastify/fastify-csrf/pull/51","hostname":"github.com","tags":["X Refsource MISC","WEB","Patch","Third Party Advisory"]},{"url":"https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html","label":"cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html","hostname":"cheatsheetseries.owasp.org","tags":["X Refsource MISC","WEB","Third Party Advisory"]},{"url":"https://github.com/fastify/fastify-csrf/releases/tag/v3.1.0","label":"github.com/fastify/fastify-csrf/releases/tag/v3.1.0","hostname":"github.com","tags":["X Refsource MISC","WEB","Third Party Advisory"]},{"url":"https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf","label":"owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf","hostname":"owasp.org","tags":["X Refsource MISC","WEB","Third Party Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29624","label":"nvd.nist.gov/vuln/detail/CVE-2021-29624","hostname":"nvd.nist.gov","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2021-05-19T21:15:28.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-03T22:11:06.350Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"priority":{"label":"routine","tag":null,"reason":"Not severe (CVSS 6.5, network access); no exploitation reported by the 5 checked sources","nextStep":"Fix in the normal cadence","rank":[0,0,0,0,1,65],"checkedSources":["cisa","enisa","circl","shadowserver","cisa-adp"],"evidence":[{"type":"epss","source":"FIRST","date":"2026-12-04T00:00:00.000Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"value":0.00829,"stale":false,"promoted":null},{"type":"cvss","source":"cve.org","date":"2024-08-03T22:11:06.350Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1","headline":true},{"type":"cvss","source":"osv_npm","date":"2024-08-03T22:11:06.350Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"},{"type":"cvss","source":"nvd","date":"2024-08-03T22:11:06.350Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"},{"type":"cvss","source":"nvd","date":"2024-08-03T22:11:06.350Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","version":"2.0"}],"epss":{"value":0.00829,"date":"2026-12-04T00:00:00.000Z","stale":false,"promoted":null},"sources":[{"id":"cisa","lastSuccessfulSync":"2026-12-05T09:01:26.874Z","state":"fresh"},{"id":"enisa","lastSuccessfulSync":"2026-12-05T09:01:27.430Z","state":"fresh"},{"id":"circl","lastSuccessfulSync":"2026-12-05T09:01:27.610Z","state":"fresh"},{"id":"shadowserver","lastSuccessfulSync":null,"state":"unavailable"},{"id":"cisa-adp","lastSuccessfulSync":"2026-12-05T09:01:02.756Z","state":"fresh"},{"id":"epss","lastSuccessfulSync":"2026-12-05T09:01:25.188Z","state":"fresh"},{"id":"osv","lastSuccessfulSync":"2026-12-05T09:01:24.136Z","state":"fresh"}],"feedEvent":null},"meta":{"dataAsOf":"2026-12-05T09:21:47.204Z","stale":false,"partial":false}}