{"id":"CVE-2022-41919","aliases":["GHSA-3fjj-p79j-c9hh"],"url":"https://o3.security/vulnerability/CVE-2022-41919","summary":"Fastify vulnerable to Cross-Site Request Forgery (CSRF) attack via incorrect content type","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)\n","published":"2022-11-22T00:00:00Z","modified":"2026-08-12T03:51:23.191285263Z","cvss":{"score":4.2,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N"},"epss":{"score":0.00369,"percentile":0.30138,"asOf":"2026-08-23"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"fastify","fixedVersion":"4.10.2"},{"ecosystem":"npm","name":"fastify","fixedVersion":"3.29.4"}],"fix":{"url":"https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9","label":"fastify/fastify@62dde76"},"references":[{"type":"WEB","url":"https://www.npmjs.com/package/%40fastify/csrf"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/41xxx/CVE-2022-41919.json"},{"type":"ADVISORY","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":"FIX","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"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:23.191285263Z"}}