CVE-2026-6270: @fastify/middie Middleware Authentication Bypass in Child Plugin Scopes
Summary
CVE-2026-6270: @fastify/middie vulnerable to middleware authentication bypass in child plugin scopes. Affects @fastify/middie versions < 9.3.2. Fixed in 9.3.2. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The @fastify/middie package is a middleware integration tool for Fastify, designed to facilitate the use of middleware functions in Fastify applications. It allows developers to easily incorporate middleware for tasks such as authentication, authorization, and rate limiting. However, a critical vulnerability has been identified in versions 9.3.1 and earlier, which can lead to security controls being bypassed in child plugin scopes.
Vulnerability Detail
The vulnerability arises from the incorrect re-prefixing of middleware paths when they are propagated to child plugin scopes. When a child plugin is registered with a prefix that overlaps with a parent-scoped middleware path, the middleware path is modified during inheritance. This modification results in a silent failure to match incoming requests, effectively bypassing all middleware security controls for routes defined within the affected child plugin scopes. This includes critical security mechanisms such as authentication, authorization, and rate limiting, leading to potential unauthorized access to sensitive resources.
How To Fix
Minimum fixed version
9.3.2
This is the first release that contains the fix.
npm install @fastify/middie@9.3.2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There are no workarounds available for this vulnerability. The only effective solution is to upgrade to the patched version of the package.
Conclusion
The vulnerability identified as CVE-2026-6270 in the @fastify/middie package poses a significant risk by allowing middleware authentication bypass in child plugin scopes. It is crucial for developers using this package to upgrade to version 9.3.2 or later to ensure the security of their applications.
See every vulnerability recorded for @fastify/middie →
FAQ
The vulnerability allows for a complete bypass of middleware security controls, which can lead to unauthorized access to routes defined in child plugin scopes.
Versions 9.3.1 and earlier of @fastify/middie are affected by this vulnerability.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground at Vulert Scanner without any signup.
The CVSS score of this vulnerability is 9.1, indicating a critical level of severity.
Unfortunately, there are no workarounds available. The only way to mitigate the risk is to upgrade to the patched version.
References
Related vulnerabilities
Recent vulnerabilities recorded for @fastify/middie.