{"schemaVersion":4,"id":"CVE-2023-27495","aliases":["GHSA-qrgf-9gpc-vrxw"],"status":"published","duplicateOf":null,"title":"Bypass of CSRF protection in the presence of predictable userInfo in @fastify/csrf-protection","description":"@fastify/csrf-protection is a plugin which helps protect Fastify servers against CSRF attacks. The CSRF protection enforced by the @fastify/csrf-protection library in combination with @fastify/cookie can be bypassed from network and same-site attackers under certain conditions. @fastify/csrf-protection supports an optional userInfo parameter that binds the CSRF token to the user. This parameter has been introduced to prevent cookie-tossing attacks as a fix for CVE-2021-29624. Whenever userInfo parameter is missing, or its value can be predicted for the target user account, network and same-site attackers can 1. fixate a _csrf cookie in the victim's browser, and 2. forge CSRF tokens that are valid for the victim's session. This allows attackers to bypass the CSRF protection mechanism. As a fix, @fastify/csrf-protection starting from version 6.3.0 (and v4.1.0) includes a server-defined secret hmacKey that cryptographically binds the CSRF token to the value of the _csrf cookie and the userInfo parameter, making tokens non-spoofable by attackers. This protection is effective as long as the userInfo parameter is unique for each user. This is patched in versions 6.3.0 and v4.1.0. Users are advised to upgrade. Users unable to upgrade may use a random, non-predictable userInfo parameter for each user as a mitigation.","dates":{"published":"2023-04-20T17:05:21.515Z","modified":"2025-02-05T16:07:38.884Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":6.5,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"NVD","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":5.3,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:H/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":5.3,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","exploitability":4.1,"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}]},"epss":{"probability":0.00331,"percentile":0.28327,"severity":"low","asOf":"2026-12-04T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-11-04T00:00:00.000Z","baselineScore":0.00331},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-22T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-23T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-24T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-25T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-26T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-27T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-28T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-29T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-30T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-10-31T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-01T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-02T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-03T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-04T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00331,"percentile":0.28327}],"last30":[{"date":"2026-11-04T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.0039,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00331,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00331,"percentile":0.28327}]},"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-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":"csrf-protection","name":"csrf-protection","label":"csrf-protection","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 4.1.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"4.1.0","endInclusive":false}},{"text":"≥ 5.0.0, < 6.3.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":"5.0.0","startInclusive":true,"end":"6.3.0","endInclusive":false}}],"versionsText":"< 4.1.0 | ≥ 5.0.0, < 6.3.0","eol":null,"hubHref":"/vendor/fastify/csrf-protection"},{"vendor":"@fastify","product":"csrf-protection","name":"@fastify/csrf-protection","label":"csrf-protection","ecosystem":"Npm","cpePart":null,"purl":"pkg:npm/@fastify/csrf-protection","purlType":"npm","versions":[{"text":"< 4.1.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"4.1.0","endInclusive":false}},{"text":"≥ 5.0.0, < 6.3.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":"5.0.0","startInclusive":true,"end":"6.3.0","endInclusive":false}}],"versionsText":"< 4.1.0 | ≥ 5.0.0, < 6.3.0","eol":null,"hubHref":null}],"affectedCount":2,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw","label":"github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Vendor Advisory"]},{"url":"https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058","label":"github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058","hostname":"github.com","tags":["X Refsource MISC","WEB","Patch"]},{"url":"https://www.cvedetails.com/cve/CVE-2021-29624","label":"www.cvedetails.com/cve/CVE-2021-29624","hostname":"www.cvedetails.com","tags":["X Refsource MISC","WEB","Third Party Advisory"]},{"url":"https://github.com/fastify/csrf-protection/security/advisories/GHSA-rc4q-9m69-gqp8","label":"github.com/fastify/csrf-protection/security/advisories/GHSA-rc4q-9m69-gqp8","hostname":"github.com","tags":["WEB"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-27495","label":"nvd.nist.gov/vuln/detail/CVE-2023-27495","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/fastify/csrf-protection","label":"github.com/fastify/csrf-protection","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/fastify/csrf-protection/releases/tag/v4.1.0","label":"github.com/fastify/csrf-protection/releases/tag/v4.1.0","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/fastify/csrf-protection/releases/tag/v6.3.0","label":"github.com/fastify/csrf-protection/releases/tag/v6.3.0","hostname":"github.com","tags":["WEB"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2023-04-20T17:05:21.515Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-02-05T16:07:38.884Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"priority":{"label":"routine","tag":null,"reason":"Not severe (CVSS 5.3, network access); no exploitation reported by the 5 checked sources","nextStep":"Fix in the normal cadence","rank":[0,0,0,0,0,53],"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.00331,"stale":false,"promoted":null},{"type":"cvss","source":"cve.org","date":"2025-02-05T16:07:38.884Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1","headline":true},{"type":"cvss","source":"osv_npm","date":"2025-02-05T16:07:38.884Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"},{"type":"cvss","source":"nvd","date":"2025-02-05T16:07:38.884Z","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":"adp","source":"cisa-adp","date":"2025-02-05T16:07:27.864Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"exploitation":"none"}],"epss":{"value":0.00331,"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:55:53.075Z","stale":false,"partial":false}}