{"id":"CVE-2022-41919","aliases":["GHSA-3fjj-p79j-c9hh"],"summary":"Fastify vulnerable to Cross-Site Request Forgery (CSRF) attack via incorrect content type","published_at":"2022-11-21T22:28:11Z","modified_at":"2025-04-23T16:36:24.268Z","products":[],"rating":{"severity":"high","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","attack_path":"internet_unauthenticated","user_interaction":true,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.004910000134259462,"percentile":0.42996999621391296,"date":"2026-11-19T00:00:00Z"},"priority":10.3,"details":"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_stack":[],"affected_other":[{"ecosystem":"CVE","package":"fastify/fastify","versions":[">= 4.0.0, < 4.10.2",">= 3.0.0, < 3.29.4"],"provider":"cvelistv5","source":"CVE-2022-41919","relation":"self"},{"ecosystem":"NVD","package":"fastify:fastify","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.29.4"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.10.2"}]}],"fixed":["3.29.4","4.10.2"],"provider":"nvd","source":"CVE-2022-41919","relation":"self"},{"ecosystem":"npm","package":"fastify","purl":"pkg:npm/fastify","ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"4.10.2"}]}],"fixed":["4.10.2"],"provider":"osv","source":"GHSA-3fjj-p79j-c9hh","relation":"self"},{"ecosystem":"npm","package":"fastify","purl":"pkg:npm/fastify","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.29.4"}]}],"fixed":["3.29.4"],"provider":"osv","source":"GHSA-3fjj-p79j-c9hh","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces","cpe":"cpe:/a:redhat:openshift_devspaces:3","status":"affected","packages":["devspaces/dashboard-rhel8"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2022-41919"}],"records":[{"provider":"cvelistv5","source_id":"CVE-2022-41919","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2022-41919","license":"CC-BY-4.0","published_at":"2022-11-22T00:00:00Z","modified_at":"2025-04-23T16:36:24.268Z","summary":"Fastify vulnerable to Cross-Site Request Forgery (CSRF) attack via incorrect content type","details":"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'.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N","source":"CVE-2022-41919"}],"affected":[{"ecosystem":"CVE","package":"fastify/fastify","versions":[">= 4.0.0, < 4.10.2",">= 3.0.0, < 3.29.4"],"provider":"cvelistv5","source":"CVE-2022-41919","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh"},{"type":"WEB","url":"https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9"},{"type":"WEB","url":"https://www.npmjs.com/package/%40fastify/csrf"}]},{"provider":"nvd","source_id":"CVE-2022-41919","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41919","severity":[],"affected":[{"ecosystem":"NVD","package":"fastify:fastify","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.29.4"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.10.2"}]}],"fixed":["3.29.4","4.10.2"],"provider":"nvd","source":"CVE-2022-41919","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"GHSA-3fjj-p79j-c9hh","relation":"self","url":"https://osv.dev/vulnerability/GHSA-3fjj-p79j-c9hh","license":"CC-BY-4.0","published_at":"2022-11-21T22:28:11Z","modified_at":"2023-11-08T04:10:35.631515Z","summary":"Fastify: Incorrect Content-Type parsing can lead to CSRF attack","details":"### Impact\n\nThe attacker can use the incorrect `Content-Type` to bypass the `Pre-Flight` checking of `fetch`. `fetch()` requests with Content-Type’s [essence](https://mimesniff.spec.whatwg.org/#mime-type-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](https://fetch.spec.whatwg.org/#simple-header), and therefore they could lead to a  Cross-Site Request Forgery attack.\n\n### Patches\nFor `4.x` users, please update to at least `4.10.2`\nFor `3.x` users, please update to at least `3.29.4`\n\n### Workarounds\n\nImplement Cross-Site Request Forgery protection using [`@fastify/csrf`](https://www.npmjs.com/package/@fastify/csrf).\n\n### References\n\nCheck out the HackerOne report: https://hackerone.com/reports/1763832.\n\n### For more information\n\n[Fastify security policy](https://github.com/fastify/fastify/security/policy)","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N","source":"GHSA-3fjj-p79j-c9hh"}],"affected":[{"ecosystem":"npm","package":"fastify","purl":"pkg:npm/fastify","ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"4.10.2"}]}],"fixed":["4.10.2"],"provider":"osv","source":"GHSA-3fjj-p79j-c9hh","relation":"self"},{"ecosystem":"npm","package":"fastify","purl":"pkg:npm/fastify","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.29.4"}]}],"fixed":["3.29.4"],"provider":"osv","source":"GHSA-3fjj-p79j-c9hh","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41919"},{"type":"WEB","url":"https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9"},{"type":"PACKAGE","url":"https://github.com/fastify/fastify"},{"type":"WEB","url":"https://www.npmjs.com/package/@fastify/csrf"}]},{"provider":"redhat-vex","source_id":"CVE-2022-41919","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2022-41919","license":"CC-BY-4.0","published_at":"2022-11-22T00:00:00Z","modified_at":"2023-07-07T08:28:36Z","summary":"fastify: CSRF","details":"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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"CVE-2022-41919"},{"type":"Red Hat","score":"Moderate","source":"CVE-2022-41919"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces","cpe":"cpe:/a:redhat:openshift_devspaces:3","status":"affected","packages":["devspaces/dashboard-rhel8"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2022-41919"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2022/cve-2022-41919.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2022-41919"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2159502"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2022-41919"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41919"},{"type":"WEB","url":"https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9"},{"type":"WEB","url":"https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh"},{"type":"WEB","url":"https://www.npmjs.com/package/@fastify/csrf"}]}],"references":[{"type":"WEB","url":"https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh"},{"type":"WEB","url":"https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9"},{"type":"WEB","url":"https://www.npmjs.com/package/%40fastify/csrf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41919"},{"type":"PACKAGE","url":"https://github.com/fastify/fastify"},{"type":"WEB","url":"https://www.npmjs.com/package/@fastify/csrf"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2022/cve-2022-41919.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2022-41919"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2159502"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2022-41919"}],"sources":[{"provider":"cvelistv5","source_id":"CVE-2022-41919","url":"https://www.cve.org/CVERecord?id=CVE-2022-41919","license":"CC-BY-4.0","modified_at":"2025-04-23T16:36:24.268Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2022-41919","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41919","relation":"self"},{"provider":"osv","source_id":"GHSA-3fjj-p79j-c9hh","url":"https://osv.dev/vulnerability/GHSA-3fjj-p79j-c9hh","license":"CC-BY-4.0","modified_at":"2023-11-08T04:10:35.631515Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2022-41919","url":"https://access.redhat.com/security/cve/CVE-2022-41919","license":"CC-BY-4.0","modified_at":"2023-07-07T08:28:36Z","relation":"self"}]}
