CVE-2022-41919: Fastify vulnerable to Cross-Site Request Forgery (CSRF) attack via incorrect content type

Published Nov 22, 2022
·
Updated

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

2 affected components
fastify Fastify Node.js>=3.0.0<3.29.4
fastify Fastify Node.js>=4.0.0<4.10.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 4.10.2
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.29.4
  3. 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

Nov 22, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

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.

2

How do I fix CVE-2022-41919?

To fix CVE-2022-41919, upgrade Fastify to the latest version that patches this vulnerability.

3

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.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203