Description
@fastify/middie is the Express-style middleware engine for Fastify. In versions from 9.0.0 through 9.3.5, the use() function joined a path-scoped middleware's mount path to the plugin scope prefix in a way that could diverge from the path Fastify's router serves, most often when the scope prefix ended in a slash, and also for array mount paths and for mount paths written without a leading slash. When the two paths disagreed, the middleware was silently skipped while the route handler still ran, so path-scoped middleware such as authentication, authorization, or rate limiting could be bypassed by a single unauthenticated request. The issue is fixed in @fastify/middie 9.3.6, and users should upgrade to 9.3.6 or later. As a workaround, enforce authorization in a Fastify hook such as preHandler that runs after the router has resolved the request.
Published: 2026-10-20
Score: 9.1 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Authentication bypass via path-scoped middleware skipping
Action: Upgrade Now
AI Analysis

Impact

@fastify/middie’s use() function improperly concatenates a middleware’s mount path with the plugin’s scope prefix. When the scope prefix ends with a slash, an array mount path is used, or a path is written without a leading slash, the resulting paths can diverge from the path that Fastify’s router serves. In such cases the middleware is silently ignored while the route handler runs, allowing unauthenticated requests to bypass authentication, authorization, or rate‑limiting logic. This flaw is a classic example of a logic error that can be mitigated by correcting the path calculation (CWE‑436).

Affected Systems

The vulnerability affects the @fastify/middie package in all releases from 9.0.0 through 9.3.5. Users running versions within this range are subject to the path‑scoped middleware bypass. Versions 9.3.6 and later contain the fix. The package is identified by the entity @fastify/middie.

Risk and Exploitability

The assessed CVSS score of 9.1 classifies the issue as critical, indicating a high likelihood of significant impact if exploited. No EPSS score is available, and the vulnerability is not listed in CISA’s KEV catalog. Based on the described logic flaw, the attack vector is likely an unauthenticated HTTP request directed at any route that relies on path‑scoped middleware. An attacker can easily craft such a request because the bypass occurs automatically when the mount and scope paths are misaligned, requiring no additional privileges. This makes the vulnerability straightforward to exploit in any exposed Fastify application using the affected middie versions.

Generated by OpenCVE AI on October 22, 2026 at 19:48 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade @fastify/middie to version 9.3.6 or later to apply the official fix
  • If immediate upgrade is not possible, add a Fastify hook such as preHandler to enforce authentication or other security checks after routing has resolved the request
  • Review all middleware mount paths and plugin scope prefixes to ensure they do not create a leading or trailing slash mismatch that would leave the middleware unreachable

Generated by OpenCVE AI on October 22, 2026 at 19:48 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 30 Oct 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 20 Oct 2026 21:00:00 +0000

Type Values Removed Values Added
Description @fastify/middie is the Express-style middleware engine for Fastify. In versions from 9.0.0 through 9.3.5, the use() function joined a path-scoped middleware's mount path to the plugin scope prefix in a way that could diverge from the path Fastify's router serves, most often when the scope prefix ended in a slash, and also for array mount paths and for mount paths written without a leading slash. When the two paths disagreed, the middleware was silently skipped while the route handler still ran, so path-scoped middleware such as authentication, authorization, or rate limiting could be bypassed by a single unauthenticated request. The issue is fixed in @fastify/middie 9.3.6, and users should upgrade to 9.3.6 or later. As a workaround, enforce authorization in a Fastify hook such as preHandler that runs after the router has resolved the request.
Title @fastify/middie vulnerable to path-scoped middleware bypass via scope prefix mismatch
Weaknesses CWE-436
References
Metrics cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: openjs

Published:

Updated: 2026-10-30T17:17:28.727Z

Reserved: 2026-10-19T17:43:39.048Z

Link: CVE-2026-112712

cve-icon Vulnrichment

Updated: 2026-10-30T15:48:30.358Z

cve-icon NVD

Status : Deferred

Published: 2026-10-20T21:17:17.910

Modified: 2026-10-30T18:17:21.243

Link: CVE-2026-112712

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T20:00:12Z

Weaknesses