Read the docs

Middleware bypass in @fastify/express via nested mount path arrays

Priority LOW 33CWE-436Published · Updated

Key facts

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

Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-863.

Summary

@fastify/express from 4.0.7 before 4.0.14 is affected. When middleware is mounted on a nested array of mount paths, the plugin rewrites only the top level of the array, so the middleware is skipped for some requests (CWE-436). A remote attacker without privileges can bypass authentication or other middleware-based access controls on the affected routes.

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

Description from the CNA

@fastify/express is the plugin that lets an application run Express middleware and Express applications inside the Fastify web framework. In versions from 4.0.7 before 4.0.14, when middleware is mounted on a nested array of mount paths the plugin rewrites only the top level of the array, so paths inside a nested array are not adjusted for a plugin registered under a prefix and the middleware never runs for them, a nested regular-expression mount keeps its global or sticky flag and is matched statefully so it is skipped on alternating requests, a nested regular expression is not matched case-insensitively when case sensitivity is disabled, and nested dynamic paths are not covered by the earlier empty-segment check. An attacker can use any of these to bypass authentication or other middleware-based access controls on the affected routes. The issue is fixed in @fastify/express 4.0.14, and users should upgrade to 4.0.14 or later. As a workaround, flatten mount path arrays before passing them to the plugin, or enforce authentication in a Fastify hook such as preHandler that runs after the router resolves the request.

Why it matters now

EPSS 0.00435 29th percentileScored 2026-11-30
Fix Fixed @fastify/express (@fastify/express): 4.0.14

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
@fastify/express@fastify/express4.0.7 to before 4.0.144.0.14Patch availableCNA
  • @fastify/express Vendor@fastify/express Affected 4.0.7 to before 4.0.14 Fixed in 4.0.14 Patch available CNA

Remediation

Upgrade @fastify/express to 4.0.14 or later, which fixes the issue. Until then, flatten mount path arrays before passing them to the plugin, or enforce authentication in a Fastify hook such as preHandler that runs after the router resolves the request.

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

  • Fix · CNA @fastify/express (@fastify/express) Fixed in 4.0.14

Fixed in the same release

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

  • Release ·

    @fastify/express 4.0.14

    5 records Highest priority Priority MEDIUM 1 MEDIUM, 4 LOW

    Other records, highest priority first

    • TI-2026-99002 Middleware bypass via empty route parameters in @fastify/expressPriority MEDIUM 41
    • TI-2026-99003 Middleware bypass in @fastify/express with case-insensitive routingPriority LOW 33
    • TI-2026-99001 Middleware bypass in @fastify/express via optional group mount pathsPriority LOW 33

Timeline

  1. 2026-11-26 Threatist record created from CVE-2026-135264

References

  • TI-2026-96437 @fastify/express path-scoped middleware bypass via URL decoding mismatch CVSS 3.1CRITICAL 9.1
  • TI-2026-96435 Path-scoped middleware bypass in @fastify/express skips authentication checks CVSS 3.1CRITICAL 9.1
  • TI-2026-96434 Middleware bypass in @fastify/express via empty route parameters CVSS 3.1CRITICAL 9.1
  • TI-2026-96433 @fastify/express middleware bypass via RegExp mounts under parameterized prefix CVSS 3.1CRITICAL 9.1
  • TI-2026-81130 Middleware bypass in @fastify/express via absolute-form URLs CVSS 3.1CRITICAL 9.1
  • TI-2026-99002 Middleware bypass via empty route parameters in @fastify/express CVSS 3.1CRITICAL 9.1
See all 10 →

Sources

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