CVE-2026-22037

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

Published Jan 19, 2026 CVSS 3.1 · 8.4 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

A vulnerability in the @fastify/express plugin allows an attacker to bypass middleware that protects certain paths by sending URL‑encoded characters that the middleware engine does not match. The Fastify router decodes the path before routing, so a request such as "/%61dmin" matches the protected route without the middleware being executed. This flaw is an example of Improper Input Validation (CWE‑177) and Improper Check of Exception Response (CWE‑288), enabling attackers to gain unauthorized access to endpoints that are otherwise restricted.

Affected Systems

The issue affects the fastify:fastify‑express plugin in any Node.js application that uses @fastify/express version prior to 4.0.3. The vulnerability is present in every installation of the plugin that registers middleware with a specific path prefix before the patch is applied.

Risk and Exploitability

The risk is high, with a CVSS score of 8.4, yet the EPSS score is very low (<1%), indicating limited current exploitation activity. It is not listed in the CISA KEV catalog. The likely attack vector is remote, where an attacker crafts HTTP requests containing URL‑encoded paths to reach protected endpoints. No special privileges or additional network access are required beyond the ability to send HTTP traffic to the vulnerable application.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the @fastify/express package to version 4.0.3 or newer to incorporate the fix against URL‑encoding bypass.
  • Verify that all middleware path prefixes are explicit and test that encoded URLs still trigger the intended middleware logic.
  • Implement application‑level input validation or deploy a web application firewall that normalizes or rejects encoded URLs before they reach the application.

Generated by OpenCVE AI on April 18, 2026 at 05:11 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-g6q3-96cp-5r5m @fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding)
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Fastify
Fastify fastify
Vendors & Products Fastify
Fastify fastify
Type Values Removed Values Added
Description 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.
Title @fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding)
Weaknesses CWE-177
CWE-288
References
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L'}

Weaknesses
  • CWE-177

    Improper Handling of URL Encoding (Hex Encoding)

  • CWE-288

    Authentication Bypass Using an Alternate Path or Channel

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jan 20, 2026, 9:34 PM
Reserved
Jan 5, 2026, 10:30 PM
Status
Deferred
Published
Jan 19, 2026, 5:15 PM
Modified
Jun 17, 2026, 10:19 AM