Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-22037: CWE-177: Improper Handling of URL Encoding (Hex Encoding) in fastify fastify-express

0
High
VulnerabilityCVE-2026-22037cvecve-2026-22037cwe-177cwe-288
Published: Mon Jan 19 2026 (01/19/2026, 16:48:10 UTC)
Source: CVE Database V5
Vendor/Project: fastify
Product: fastify-express

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.

AI-Powered Analysis

AILast updated: 01/19/2026, 19:03:23 UTC

Technical Analysis

The vulnerability CVE-2026-22037 affects the @fastify/express plugin, which integrates Express middleware compatibility into the Fastify web framework. The core issue is an improper handling of URL-encoded characters during middleware path matching. Specifically, when middleware is registered with a path prefix (e.g., /admin), the matching logic in @fastify/express does not decode URL-encoded characters before matching. For example, an attacker can use /%61dmin (where %61 is the ASCII hex code for 'a') to bypass middleware checks because the middleware matching fails to recognize this encoded path as /admin and thus does not execute the middleware. However, the Fastify router underneath correctly decodes the path and matches the route handler, allowing the request to reach protected endpoints without the middleware's intended constraints. This discrepancy leads to a bypass of middleware protections, potentially exposing sensitive routes to unauthorized users. The vulnerability is categorized under CWE-177 (Improper Handling of URL Encoding) and CWE-288 (Authentication Bypass Using an Alternate Path). It differs from a similar vulnerability (CVE-2026-22031) in another npm module, as it affects a distinct codebase. The vulnerability affects all versions of @fastify/express prior to 4.0.3, which contains the patch. The CVSS v3.1 score is 8.4 (High), reflecting network attack vector, high impact on confidentiality and integrity, low privileges required, no user interaction, and a scope change. No known exploits have been reported in the wild as of the publication date. The vulnerability could be exploited remotely by sending specially crafted requests with URL-encoded paths to bypass middleware protections and access sensitive endpoints.

Potential Impact

For European organizations, this vulnerability poses a significant risk to web applications built on Fastify using the @fastify/express plugin, particularly those that rely on middleware for authentication, authorization, or other security controls. Attackers can bypass middleware protections by exploiting URL encoding discrepancies, potentially gaining unauthorized access to sensitive data or functionality. This can lead to data breaches, unauthorized operations, and compromise of application integrity. Given the widespread adoption of Node.js frameworks in Europe’s tech sector, especially in fintech, e-commerce, and public services, the impact could be substantial. Organizations handling personal data under GDPR may face compliance violations if unauthorized access leads to data exposure. The vulnerability's network-based attack vector and lack of user interaction requirements make it easier to exploit remotely, increasing the threat surface. Additionally, the scope change in the CVSS score indicates that the vulnerability affects components beyond the initially targeted middleware, potentially impacting multiple routes and services within an application.

Mitigation Recommendations

1. Upgrade all instances of @fastify/express to version 4.0.3 or later immediately to apply the official patch. 2. Conduct a thorough audit of middleware path configurations to identify any reliance on path matching that could be bypassed via URL encoding. 3. Implement additional validation or normalization of incoming request paths at the application or proxy level to ensure consistent decoding before middleware processing. 4. Use security testing tools to simulate URL-encoded path attacks against your applications to verify middleware protections. 5. Monitor application logs for unusual access patterns involving URL-encoded paths that could indicate exploitation attempts. 6. Educate development teams about the risks of relying solely on middleware path matching for security controls and encourage defense-in-depth strategies. 7. Consider deploying web application firewalls (WAFs) with rules to detect and block suspicious URL-encoded requests targeting sensitive endpoints. 8. Review and update incident response plans to include scenarios involving middleware bypass vulnerabilities.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-01-05T22:30:38.719Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 696e7feca027839b3dc0118d

Added to database: 1/19/2026, 7:03:08 PM

Last enriched: 1/19/2026, 7:03:23 PM

Last updated: 1/19/2026, 8:10:33 PM

Views: 6

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats