{"cve":"CVE-2023-27495","nvd":{"published":"2023-04-20T18:15:07.233","modified":"2026-06-17T05:45:20.023","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"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},"cwes":["CWE-352"],"references":["https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058","https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw","https://www.cvedetails.com/cve/CVE-2021-29624","https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058","https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw"],"products":["fastify:csrf-protection"],"source":"nvd","synced_at":"2026-10-19T21:38:05.473481323+00:00"},"epss":{"cve":"CVE-2023-27495","score":0.00331,"percentile":0.26334,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-qrgf-9gpc-vrxw","url":"https://osv.dev/vulnerability/GHSA-qrgf-9gpc-vrxw","summary":"Bypass of CSRF protection in the presence of predictable userInfo","modified":"2026-09-10T03:49:57.077390149Z","packages":[{"ecosystem":"npm","name":"@fastify/csrf-protection","purl":"pkg:npm/%40fastify/csrf-protection","ranges":["<4.1.0"],"fixed":["4.1.0"]},{"ecosystem":"npm","name":"@fastify/csrf-protection","purl":"pkg:npm/%40fastify/csrf-protection","ranges":[">=5.0.0 <6.3.0"],"fixed":["6.3.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}