{"id":"CVE-2022-41919","aliases":["CVE-2022-41919","GHSA-3fjj-p79j-c9hh"],"related":[],"kind":"vulnerability","state":"published","title":"Fastify vulnerable to Cross-Site Request Forgery (CSRF) attack via incorrect content type","summary":"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'.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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'.","source":"cvelist"},{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Fastify es un framework web con una arquitectura de complementos y gastos generales mínimos. El atacante puede utilizar el \"Content-Type\" incorrecto para omitir la comprobación \"Pre-Flight\" de \"fetch\". Las solicitudes `fetch()` con la esencia de Content-Type como \"application/x-www-form-urlencoded\", \"multipart/form-data\" o \"text/plain\", podrían usarse potencialmente para invocar rutas que solo acepta el tipo de contenido `application/json`, evitando así cualquier protección CORS y, por lo tanto, podría provocar un ataque de Cross-Site Request Forgery (CSRF). Este problema se solucionó en las versiones 4.10.2 y 3.29.4. Como workaround, implemente la protección contra Cross-Site Request Forgery (CSRF) utilizando `@fastify/csrf'.","source":"nvd"}],"published":"2022-11-21T22:28:11.000Z","modified":"2026-06-17T05:04:03.767Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N","score":4.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N","score":4.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N","score":4.2,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-352"],"affected":[{"ranges":[{"version":">= 4.0.0, < 4.10.2","status":"affected"},{"version":">= 3.0.0, < 3.29.4","status":"affected"}],"vendor":"fastify","product":"fastify","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.10.2"}],"ecosystem":"npm","package":"fastify","purl":"pkg:npm/fastify","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"3.29.4"}],"ecosystem":"npm","package":"fastify","purl":"pkg:npm/fastify","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.0.0","fixed":"3.29.4"},{"status":"affected","introduced":"4.0.0","fixed":"4.10.2"}],"vendor":"fastify","product":"fastify","cpe":"cpe:2.3:a:fastify:fastify:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh","tags":["third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9","tags":["patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.npmjs.com/package/%40fastify/csrf","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41919","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/fastify/fastify","tags":["package"],"sources":["ghsa"]},{"url":"https://www.npmjs.com/package/@fastify/csrf","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-23T13:54:07.870Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-41919","url":"https://www.cve.org/CVERecord?id=CVE-2022-41919","licence":"CVE Terms of Use","modified":"2025-04-23T16:36:24.268Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3fjj-p79j-c9hh","url":"https://github.com/advisories/GHSA-3fjj-p79j-c9hh","licence":"CC-BY-4.0","modified":"2023-11-08T04:10:35.631Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-41919","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41919","licence":"Public domain","modified":"2026-06-17T05:04:03.767Z"}],"updatedAt":"2026-11-25T22:58:16.825Z","epss":{"score":0.00514,"percentile":0.37088,"date":"2026-11-30T12:00:22.000Z"}}