Skip to content
Heist/ feed
Back to feed
Medium

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

Type: advisorySources: OSV

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'.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-41919
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 17:48 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 22 Nov 2022, 00:00 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'.

osv:CVE-2022-41919
Complete source record
{
  "id": "19baf19db1f958a97456b901d5717d146cda4dace931da417367b8d6778504c3",
  "url": "https://osv.dev/vulnerability/CVE-2022-41919",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "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'.",
    "evidence": "osv:CVE-2022-41919",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2022-41919",
      "aliases": [
        "CVE-2022-41919",
        "GHSA-3fjj-p79j-c9hh"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/fastify/fastify",
              "type": "GIT",
              "events": [
                {
                  "introduced": "d2d533494b143a2c944c491c56960f1107f96733"
                },
                {
                  "fixed": "605303133ee853b9b293d545f210910473ea4553"
                },
                {
                  "introduced": "e941c24bf51af7184cf658ca138e069e8c166ef8"
                },
                {
                  "fixed": "311590c147af90e32f7bcbcc10e0d176cbbafaca"
                },
                {
                  "fixed": "62dde76f1f7aca76e38625fe8d983761f26e6fc9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:fastify:fastify:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "3.0.0"
                      },
                      {
                        "fixed": "3.29.4"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:fastify:fastify:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "4.0.0"
                      },
                      {
                        "fixed": "4.10.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "62dde76f1f7aca76e38625fe8d983761f26e6fc9"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.29.3",
            "v4.10.1",
            "v4.10.0",
            "v4.9.2",
            "v4.9.1",
            "v4.9.0",
            "v4.8.1",
            "v3.29.2",
            "v4.8.0",
            "v4.7.0",
            "v4.6.0",
            "v4.5.3",
            "v4.5.2",
            "v4.5.1",
            "v4.5.0",
            "v4.4.0",
            "v4.3.0",
            "v4.2.1",
            "v4.2.0",
            "v4.1.0",
            "v4.0.3",
            "v4.0.2",
            "v4.0.1",
            "v4.0.0",
            "v3.29.0",
            "v3.28.0",
            "v3.27.4",
            "v3.27.3",
            "v3.27.2",
            "v3.27.1",
            "v3.27.0",
            "v3.26.0",
            "v3.25.3",
            "v3.25.2",
            "v3.25.1",
            "v3.25.0",
            "v3.24.1",
            "v3.24.0",
            "v3.23.1",
            "v3.23.0",
            "v3.22.1",
            "v3.22.0",
            "v3.21.6",
            "v3.21.5",
            "v3.21.4",
            "v3.21.3",
            "v3.21.2",
            "v3.21.1",
            "v3.21.0",
            "v3.20.2",
            "v3.20.1",
            "v3.20.0",
            "v3.19.2",
            "v3.19.1",
            "v3.19.0",
            "v3.18.1",
            "v3.18.0",
            "v3.17.0",
            "v3.16.2",
            "v3.16.1",
            "v3.16.0",
            "v3.15.1",
            "v3.15.0",
            "v3.14.2",
            "v3.14.1",
            "v3.14.0",
            "v3.13.0",
            "v3.12.0",
            "v3.11.0",
            "v3.10.1",
            "v3.10.0",
            "v3.9.2",
            "v3.9.1",
            "v3.9.0",
            "v3.8.0",
            "v3.7.0",
            "v3.6.0",
            "v3.5.1",
            "v3.5.0",
            "v3.4.1",
            "v3.4.0",
            "v3.3.0",
            "v3.2.1",
            "v3.2.0",
            "v3.1.1",
            "v3.1.0",
            "v3.0.3",
            "v3.0.2",
            "v3.0.1",
            "v3.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-41919.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:31.260930405Z",
      "provider": "osv",
      "references": [
        "https://www.npmjs.com/package/%40fastify/csrf",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/41xxx/CVE-2022-41919.json",
        "https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-41919",
        "https://github.com/fastify/fastify/commit/62dde76f1f7aca76e38625fe8d983761f26e6fc9"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-352"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/41xxx/CVE-2022-41919.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-41919",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 498001,
  "published_at": "2022-11-22T00:00:00+00:00"
}