Read the docs

Path-scoped middleware bypass in @fastify/middie via array mount paths

Priority LOW 35CWE-1287Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
High
Impact type
—
Confidentiality · integrity · availability
High · High · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA.

Summary

@fastify/middie from 8.3.0 before 9.3.7 mishandles array mount paths for path-scoped middleware, so the path normalization helper only handles strings and leaves array elements unchanged. A trailing slash on an element survives into the route-matching regular expression, and a root path element is dropped, so requests to subroutes of the affected mount paths skip the middleware. An unauthenticated remote attacker can reach protected routes when security relevant middleware such as authentication or authorization is mounted on such an array of paths.

Written with Claude Haiku 5.5 from the sources below · 2026-11-19

Description from the CNA

@fastify/middie is the middleware engine that adds Express and Connect style middleware support to Fastify. In versions 8.3.0 through 9.3.6, the internal helper that normalizes a path-scoped middleware's mount path only handles string inputs, but the use method also accepts an array of mount paths and passes it through unchanged, so the normalization silently does nothing. As a result, a trailing slash on an array element survives into the generated route-matching regular expression, and an element that is exactly the root path, meaning a catch-all mount, is dropped entirely. Requests to subroutes of the affected mount paths then skip the path-scoped middleware, such as authentication, authorization, or rate limiting, while Fastify's router still dispatches them to the handler, allowing an unauthenticated client to reach protected routes. Applications are affected when they mount middleware on an array of paths in which an element ends with a slash, including one introduced by a plugin prefix that ends with a slash, or is exactly the root path. The issue is fixed in @fastify/middie 9.3.7, and users should upgrade to 9.3.7 or later. As a workaround, enforce authorization in a Fastify hook such as preHandler that runs after routing, and avoid array mount paths with a trailing slash element for security relevant middleware.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00451 31st percentileScored 2026-11-30
Fix Fixed @fastify/middie (@fastify/middie): 9.3.7

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
fastify@fastify/middie8.3.0 to before 9.3.79.3.7Patch availableCNA
  • @fastify/middie Vendorfastify Affected 8.3.0 to before 9.3.7 Fixed in 9.3.7 Patch available CNA

CPE names Threatist (inferred) · 1

Inferred from how NVD named this product before; not given by a source.

CPEVersionsRoleVendor
cpe:2.3:a:fastify:fastify\/middie:*:*:*:*:*:*:*:*——fastify
  • cpe:2.3:a:fastify:fastify\/middie:*:*:*:*:*:*:*:* Versions — — ·fastify

Remediation

Upgrade @fastify/middie to 9.3.7 or later, which fixes the issue. As a workaround, enforce authorization in a Fastify hook such as preHandler that runs after routing, and avoid array mount paths with a trailing slash element for security relevant middleware.

Written with Claude Haiku 5.5 from the sources below · 2026-11-19

  • Fix · CNA @fastify/middie (@fastify/middie) Fixed in 9.3.7

Fixed in the same release

Records fixed by the same vendor advisory or release, as the CNA lists them.

  • Release ·

    @fastify/middie 9.3.7

    3 records Highest priority Priority LOW 3 LOW

    Other records, highest priority first

    • TI-2026-94494 Case folding bypass in @fastify/middie skips path-scoped middlewarePriority LOW 35
    • TI-2026-94496 Path-scoped middleware bypass in @fastify/middie via duplicate slashesPriority LOW 22

Timeline

  1. 2026-11-19 Threatist record created from CVE-2026-132131
  2. 2026-11-19 CISA SSVC decision points changed

References

  • TI-2026-26180 @fastify/express vulnerable to middleware authentication bypass via URL normalization… CVSS 4.0CRITICAL 9.1
  • TI-2026-26179 @fastify/express vulnerable to middleware path doubling causing authentication bypass in child plugin scopes CVSS 3.1CRITICAL 9.1
  • TI-2026-26177 @fastify/reply-from vulnerable to connection header abuse enabling stripping of proxy-added headers CVSS 4.0CRITICAL 9.0
  • TI-2026-05498 @fastify/middie vulnerable to middleware authentication bypass in child plugin scopes CVSS 3.1CRITICAL 9.1
  • TI-2023-15307 Cross-site request forgery in npm @fastify/oauth2 CVSS 3.1HIGH 8.8
  • TI-2026-17731 @fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding) CVSS 3.1HIGH 8.4
See all 92 →

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences