Summary
CVE-2026-85184 is a critical path-scoped middleware bypass vulnerability affecting @fastify/middie, the middleware compatibility layer for the Fastify Node.js web framework. The flaw allows an unauthenticated, remote attacker to reach protected route handlers by crafting requests with an absolute-form request target, causing Fastify’s middleware layer and its router to disagree on the resolved path. The vulnerability carries a CVSS v3.1 base score of 9.1 (Critical).
Technical details
- Root cause: @fastify/middie decides whether to execute path-scoped middleware by matching against the raw request target, while Fastify’s underlying router resolves an absolute-form request target (e.g.,
GET http://host/private/secrets HTTP/1.1) down to its path component before dispatching to a handler. This creates an interpretation conflict (CWE-436) between the two components. - Trigger conditions: An attacker sends an HTTP request using an absolute-form request-target instead of the typical origin-form (relative path) target. Middie fails to match this raw target against its registered path-scoped middleware rules, so the middleware (e.g., authentication, authorization, rate limiting, or auditing logic) is skipped, while Fastify’s router still normalizes and routes the request to the intended, protected handler.
- Attack vector: Network-based, requires no authentication, no user interaction, and low attack complexity — a single crafted HTTP request is sufficient.
- Impact: Attackers can bypass authentication and authorization controls enforced via path-scoped middleware, gaining unauthorized access to protected endpoints and data. The vector reflects high confidentiality and integrity impact with no availability impact.
Affected software
- @fastify/middie (npm package) versions >= 9.1.0 and < 9.3.4
Severity
- CVSS v3.1 Base Score: 9.1 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - CWE-436: Interpretation Conflict
Mitigation and recommended actions
- Immediate: Upgrade @fastify/middie to version 9.3.4 or later, which resolves the request-target mismatch between the middleware layer and the Fastify router.
- If immediate patching is not possible:
- Avoid relying solely on path-scoped middleware (e.g.,
app.use('/private', authMiddleware)) for enforcing authentication or authorization decisions. - Move security-critical checks into Fastify hooks (such as
preHandler) that execute after the router has fully resolved the request path, rather than relying on middie’s pre-routing path matching. - Audit edge proxies, load balancers, and WAFs to ensure they normalize or reject requests using absolute-form request targets before they reach the application, reducing exposure while patching is completed.
- Avoid relying solely on path-scoped middleware (e.g.,

