Read the docs

Path-scoped middleware bypass in @fastify/middie via duplicate slashes

Priority LOW 22CWE-436Published · Updated

Key facts

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

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

Summary

@fastify/middie before 9.3.7 builds the match expression for path-scoped middleware without collapsing duplicate slashes, even when the ignoreDuplicateSlashes router option is enabled. A mount path containing a doubled slash is routed to the protected handler while its middleware never matches (CWE-436). A remote, unauthenticated attacker can reach the handler and skip middleware such as authentication, authorization or rate limiting.

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 up to and including 9.3.6, middie builds the match regular expression for each path-scoped middleware from its mount path without collapsing duplicate slashes, even when the application enables the ignoreDuplicateSlashes router option. Under that option Fastify's router collapses duplicate slashes in both the registered route and the request path, so a mount path containing a doubled slash is served by the router at its single-slash form while the middleware's compiled match still requires the doubled slash and never matches. A path-scoped middleware such as authentication, authorization, or rate limiting is therefore skipped while the router dispatches the request to the protected handler, without any authentication required. Applications are affected when they enable ignoreDuplicateSlashes and a middleware mount path reaches middie with a duplicate slash, most commonly when a plugin prefix that ends with a slash is joined to a mount path that starts with one. 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 mount paths and plugin prefixes that introduce duplicate slashes.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00284 13th 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
Partial

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/middiebefore 9.3.79.3.7Patch availableCNA
  • @fastify/middie Vendorfastify Affected 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 mount paths and plugin prefixes that introduce duplicate slashes.

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-94495 Path-scoped middleware bypass in @fastify/middie via array mount pathsPriority LOW 35
    • TI-2026-94494 Case folding bypass in @fastify/middie skips path-scoped middlewarePriority LOW 35

Timeline

  1. 2026-11-19 Threatist record created from CVE-2026-132133
  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