Fastify: Incorrect Content-Type parsing can lead to CSRF attack
Impact
The attacker can use the incorrect Content-Type to bypass the Pre-Flight checking of fetch. fetch() requests with Content-Type’s essence as "application/x-www-form-urlencoded", "multipart/form-data", or "text/plain", could potentially be used to invoke routes that only accepts application/json content type, thus bypassing any CORS protection, and therefore they could lead to a Cross-Site Request Forgery attack.
Patches
For 4.x users, please update to at least 4.10.2
For 3.x users, please update to at least 3.29.4
Workarounds
Implement Cross-Site Request Forgery protection using @fastify/csrf.
References
Check out the HackerOne report: https://hackerone.com/reports/1763832.
For more information
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | fastify | >= 4.0.0, < 4.10.2, >= 3.0.0, < 3.29.4 | 4.10.2, 3.29.4 |
References
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N- Weakness (CWE)
CWE-352- Platform
- npm
- Package
fastify- Disclosed
- 21.11.2022
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-3fjj-p79j-c9hh - CC BY 4.0
Vulnerability history: fastify
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 16
- First → latest
- 07.2018 09.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 8
- Medium 7
- Low 1
Disclosures per year
- 2018: 1
- 2019: 0
- 2020: 1
- 2021: 0
- 2022: 2
- 2023: 0
- 2024: 0
- 2025: 1
- 2026: 11
-
Fastify: Incorrect Content-Type parsing can lead to CSRF attack this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.