Authentication Bypass Using an Alternate Path or Channel Affecting @fastify/middie package, versions <9.3.8


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.65% (53rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-FASTIFYMIDDIE-22743506
  • published23 Nov 2026
  • disclosed21 Nov 2026
  • creditUnknown

Introduced: 21 Nov 2026

NewCVE-2026-133250  (opens in a new tab)
CWE-288  (opens in a new tab)

How to fix?

Upgrade @fastify/middie to version 9.3.8 or higher.

Overview

@fastify/middie is a Middleware engine for Fastify

Affected versions of this package are vulnerable to Authentication Bypass Using an Alternate Path or Channel via path-scoped middleware matching in lib/engine.js, where middie resolves the request path independently from Fastify's router (find-my-way), allowing the two to disagree on which path a request targets. When they disagree, the router dispatches a request to a handler covered by a middleware mount while middie skips that middleware entirely, so an unauthenticated client reaches a handler that an authentication, authorization, or rate-limiting middleware was meant to protect. Three request forms trigger the mismatch: empty parameter or wildcard values (e.g. /tenant//admin matching a /tenant/:id/admin mount), request targets that do not begin with a slash (e.g. *admin being routed to /admin), and literal percent characters in a mount path (e.g. /100%25 reaching a /100% mount that middie skips due to an extra decode step).

Workaround

Enforce authentication in a Fastify hook such as preHandler that runs after the router has resolved the request, and base the decision on the matched route (request.routeOptions.url) rather than request.url. This covers all three vectors.

CVSS Base Scores

version 4.0
version 3.1