CVE-2026-22031
HighSummary
The @fastify/middie plugin prior to version 9.1.0 has a vulnerability that allows bypassing registered middleware using URL-encoded characters. Attackers can access protected endpoints without the constraints imposed by the middleware.
Risk Assessment
Organizations may be exposed to unauthorized access to sensitive resources, potentially leading to data leaks or other serious security incidents.
Recommendation
It is recommended to update the @fastify/middie plugin to version 9.1.0 or later to mitigate this vulnerability.
Other vulnerabilities in @fastify/middie
See all- CVE-2026-33804High
Versions @fastify/middie 9.3.1 and earlier are vulnerable to middleware bypass when the deprecated ignoreDuplicateSlashes option is enabled. The middleware path matching logic does not account for duplicate slash normalization, allowing requests with duplicate slashes to bypass authentication and authorization checks.
- CVE-2026-14198Critical
A vulnerability in @fastify/middie versions 9.1.0 through 9.3.2 causes a mismatch in handling encoded slashes (%2F) between the middleware and Fastify's router. An attacker can bypass middleware used for authentication, authorization, rate limiting, or auditing by sending a crafted request with an encoded slash in the parameter position.
- CVE-2026-6270Critical
Versions of @fastify/middie up to 9.3.1 do not register inherited middleware directly on child plugin engine instances. This allows unauthenticated requests to bypass authentication and authorization checks for routes defined in child plugins.
- CVE-2026-2880Critical
A vulnerability in @fastify/middie versions < 9.2.0 can result in authentication/authorization bypass when using path-scoped middleware. When Fastify router normalization options are enabled, crafted request paths may bypass middleware checks.
- CVE-2026-14181High
Vulnerability in @fastify/middie versions 9.1.0 through 9.3.2 causes Node.js process termination when processing malformed percent-encoded sequences in request paths. The issue only affects the standalone engine API (middie.run), not the Fastify plugin path.
Original NVD description (English source)
@fastify/middie is the plugin that adds middleware support on steroids to Fastify. A security vulnerability exists in @fastify/middie prior to version 9.1.0 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. Version 9.1.0 fixes the issue.

