CVE-2022-41919: Fastify vulnerable to Cross-Site Request Forgery (CSRF) attack via incorrect content type
Fastify is a web framework with minimal overhead and plugin architecture. 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. This issue has been patched in version 4.10.2 and 3.29.4. As a workaround, implement Cross-Site Request Forgery protection using @fastify/csrf'.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.10.2 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.29.4 - Configuration
Implement CSRF protection as a workaround by using the @fastify/csrf plugin.
Fastify (Node.js web server) @fastify/csrf (CSRF protection via plugin) = enabled
Event History
Frequently Asked Questions
What is the severity of CVE-2022-41919?
CVE-2022-41919 is classified as a high severity vulnerability due to its potential to bypass security checks.
How do I fix CVE-2022-41919?
To fix CVE-2022-41919, upgrade Fastify to the latest version that patches this vulnerability.
What systems are affected by CVE-2022-41919?
CVE-2022-41919 affects Fastify versions between 3.0.0 and 3.29.4, as well as versions between 4.0.0 and 4.10.2.
What type of attacks can exploit CVE-2022-41919?
CVE-2022-41919 can be exploited to send unauthorized requests by bypassing the pre-flight checks.
Is there a known workaround for CVE-2022-41919?
There are no specific workarounds for CVE-2022-41919; the recommended action is to update to fixed versions.