Executive brief
A security flaw in the @fastify/middie middleware library allows attackers to bypass security checks on protected web folders. By using specially crafted web addresses (such as adding extra slashes or semicolons), an attacker can trick the system into skipping authentication steps while still accessing private data. This could lead to unauthorized access to sensitive information or administrative functions.
Technical details
A path normalization inconsistency exists between @fastify/middie's path matching logic and the Fastify router's (find-my-way) normalization. When specific router options like 'ignoreDuplicateSlashes' or 'useSemicolonDelimiter' are enabled, the middleware may fail to recognize a path as protected, while the router still resolves the request to a sensitive handler. An unauthenticated remote attacker can exploit this by sending crafted URLs (e.g., using '//' or ';') to bypass authentication or authorization guards. The issue is resolved in version 9.2.0; as a workaround, developers should implement security checks at the route level rather than relying solely on path-scoped middleware.
Affected products
- Fastify @fastify/middie < 9.2.0
Timeline
- 2026-02-27: disclosed
- 2026-02-27: advisory
- 2026-02-27: patched: Fixed in version 9.2.0