Skip to content
Heist/ feed
Back to feed
High

@fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding)

Type: advisorySources: OSV

The @fastify/express plugin adds full Express compatibility to Fastify. A security vulnerability exists in @fastify/express prior to version 4.0.3 where middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g., `/%61dmin` instead of `/admin`). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints. The vulnerability is caused by how @fastify/express matches requests against registered middleware paths. This vulnerability is similar to, but differs from, CVE-2026-22031 because this is a different npm module with its own code. Version 4.0.3 of @fastify/express contains a patch fort the issue.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-22037
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 01:19 UTC · Revision 1

Source evidence

@fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding)

core-osv · Original source

Published 19 Jan 2026, 16:48 UTC

The @fastify/express plugin adds full Express compatibility to Fastify. A security vulnerability exists in @fastify/express prior to version 4.0.3 where middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g., `/%61dmin` instead of `/admin`). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints. The vulnerability is caused by how @fastify/express matches requests against registered middleware paths. This vulnerability is similar to, but differs from, CVE-2026-22031 because this is a different npm module with its own code. Version 4.0.3 of @fastify/express contains a patch fort the issue.

osv:CVE-2026-22037
Complete source record
{
  "id": "6c1c25c50fe096e763695ac8e7b8d7ac583bf458a527806b183e4e4ace28e920",
  "url": "https://osv.dev/vulnerability/CVE-2026-22037",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "@fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding)",
    "summary": "The @fastify/express plugin adds full Express compatibility to Fastify. A security vulnerability exists in @fastify/express prior to version 4.0.3 where middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g., `/%61dmin` instead of `/admin`). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints. The vulnerability is caused by how @fastify/express matches requests against registered middleware paths. This vulnerability is similar to, but differs from, CVE-2026-22031 because this is a different npm module with its own code. Version 4.0.3 of @fastify/express contains a patch fort the issue.",
    "evidence": "osv:CVE-2026-22037",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-22037",
      "aliases": [
        "CVE-2026-22037",
        "GHSA-g6q3-96cp-5r5m"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/fastify/fastify-express",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "d1c061dae9fe9c60ba22ce54cad166cfb4a86993"
                },
                {
                  "fixed": "dc02a3fe1387f945143f22597baa42557d549a40"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "4.0.3"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "dc02a3fe1387f945143f22597baa42557d549a40"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v4.0.2",
            "v4.0.1",
            "v4.0.0",
            "v3.0.0",
            "v2.3.0",
            "v2.2.0",
            "v2.1.0",
            "v2.0.2",
            "v2.0.1",
            "v2.0.0",
            "v1.1.0",
            "v1.0.0",
            "v0.3.3",
            "v0.3.2",
            "v0.3.1",
            "v0.3.0",
            "v0.2.0",
            "v0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-22037.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:41.199917144Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22037.json",
        "https://github.com/fastify/fastify-express/security/advisories/GHSA-g6q3-96cp-5r5m",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-22037",
        "https://github.com/fastify/fastify-express/commit/dc02a3fe1387f945143f22597baa42557d549a40"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-177",
          "CWE-288"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22037.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-22037",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 509009,
  "published_at": "2026-01-19T16:48:10.994+00:00"
}