@fastify/middie Authentication and Authorization Bypass Vulnerability

Vulnerability

A vulnerability exists in @fastify/middie versions prior to 9.2.0, allowing authentication and authorization bypass when using path-scoped middleware. This issue arises from a normalization inconsistency between the middleware path matching and Fastify's route lookup, enabling crafted request paths to bypass middleware checks while still being routed to protected handlers. The vulnerability is exploitable when certain Fastify router normalization options are enabled, such as ignoring duplicate slashes or using semicolon delimiters, which can be exploited to access endpoints meant to be protected by middleware-based authentication or authorization controls.

Impact

Exploitation allows unauthenticated remote attackers to access endpoints protected by middleware-based authentication or authorization, potentially leading to unauthorized access to functionality and exposure of sensitive data.

Remediation

Users are advised to update to @fastify/middie version 9.2.0 or later. If the update cannot be applied immediately, it is recommended to avoid relying solely on path-scoped middleware for authentication or authorization. Instead, enforce these controls at the route level after normalization, and disable any risky normalization options if possible.

Added: Feb 27, 2026, 7:23 PM
Updated: Feb 27, 2026, 7:23 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
5.0
exploitability
6.2
remediation
0.0
relevance
3.3
threat
0.0
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.