Home / fastify / csrf-protection / CVE-2023-27495
CVE-2023-27495: is it exploited, and which versions of fastify csrf-protection are affected and fixed?
CVE-2023-27495 is a cross-site request forgery (CSRF) vulnerability in fastify csrf-protection. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 13:38 UTC). Affected: @fastify/csrf-protection before 4.1.0 and @fastify/csrf-protection from 5.0.0 before 6.3.0 (GitHub advisory GHSA-qrgf-9gpc-vrxw). Fixed in 4.1.0 and 6.3.0 (GitHub advisory GHSA-qrgf-9gpc-vrxw). Severity: Medium (5.3, CVSS 3.1, from GitHub_M).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 13:38 UTC, CVE record November 19, 2026, 07:13 UTC and NVD November 19, 2026, 07:39 UTC.
What is CVE-2023-27495?
Bypass of CSRF protection in the presence of predictable userInfo in @fastify/csrf-protection
@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.
From the CVE record by GitHub_M, last updated February 5, 2025, 16:07 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| fastify | csrf-protection | < 4.1.0 >= 5.0.0, < 6.3.0 |
As the CVE record by GitHub_M states it, last updated February 5, 2025. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| npm | @fastify/csrf-protection | < 4.1.0 | 4.1.0 | GHSA-qrgf-9gpc-vrxw |
| npm | @fastify/csrf-protection | >= 5.0.0, < 6.3.0 | 6.3.0 | GHSA-qrgf-9gpc-vrxw |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated May 2, 2023. Summary: Bypass of CSRF protection in the presence of predictable userInfo.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| fastify | csrf-protection | before 4.1.0 | application |
| fastify | csrf-protection | from 5.0.0 before 6.3.0 | application |
NVD analysis (status Modified), last modified June 17, 2026, 05:45 UTC.
How severe is CVE-2023-27495?
| Score | Version | Vector | Source |
|---|---|---|---|
| Medium 5.3 | CVSS 3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N | GitHub_M |
| Medium 6.5 | CVSS 3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2023-27495 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: none; automatable: no; technical impact: partial (CISA ADP, February 5, 2025)
- EPSS
- 0.33% probability of exploitation activity in the next 30 days, percentile 28.3 (FIRST EPSS, scores of December 2, 2026)
What kind of flaw is it?
- CWE-352 Cross-Site Request Forgery
Where are the vendor advisories and references?
- https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw x_refsource_CONFIRM
- https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058 x_refsource_MISC
- https://www.cvedetails.com/cve/CVE-2021-29624 x_refsource_MISC
When was it published, and where is the official record?
- Reserved
- March 1, 2023
- Published
- April 20, 2023, 17:05 UTC
- CVE record updated
- February 5, 2025, 16:07 UTC by GitHub_M
- NVD
- Modified, last modified June 17, 2026, 05:45 UTC
- Last checked
- CVE list November 19, 2026, 07:13 UTC; NVD November 19, 2026, 07:39 UTC; KEV December 3, 2026, 13:38 UTC; EPSS December 2, 2026
- Official record
- cve.org · NVD
Questions about CVE-2023-27495
Is CVE-2023-27495 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 13:38 UTC. FIRST's EPSS gives it a 0.33% chance of exploitation activity in the next 30 days (scores of December 2, 2026).
Which versions of fastify csrf-protection are affected by CVE-2023-27495?
@fastify/csrf-protection before 4.1.0 and @fastify/csrf-protection from 5.0.0 before 6.3.0, per the GitHub advisory GHSA-qrgf-9gpc-vrxw. The tables above give every range the sources list.
Which version fixes CVE-2023-27495?
4.1.0 and 6.3.0, per the GitHub advisory GHSA-qrgf-9gpc-vrxw. Check the vendor's advisory before you rely on it.
How severe is CVE-2023-27495?
Medium (5.3, CVSS 3.1, from GitHub_M). The severity table above shows each score with its source.
Where is the official record of CVE-2023-27495?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.