Bug 2159502 (CVE-2022-41919) - CVE-2022-41919 fastify: CSRF
Summary: CVE-2022-41919 fastify: CSRF
Keywords:
Status: NEW
Alias: CVE-2022-41919
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 2145164
TreeView+ depends on / blocked
 
Reported: 2023-01-09 19:46 UTC by Zack Miele
Modified: 2023-07-07 08:28 UTC (History)
2 users (show)

Fixed In Version: fastify 4.10.2, fastify 3.29.4
Doc Type: ---
Doc Text:
A Cross-site request forgery (CSRF) vulnerability was found in fastify due to improper handling of incorrect Content-Types. This flaw allows an attacker to use an incorrect 'Content-Type' to bypass checks to allow fetch() requests that could be used to invoke routes that only accept `application/json` content type and bypass any CORS protection.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Zack Miele 2023-01-09 19:46:53 UTC
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'.

https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9
https://www.npmjs.com/package/@fastify/csrf
https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh


Note You need to log in before you can comment on or make changes to this bug.