Case folding bypass in @fastify/middie skips path-scoped middleware
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/middie before 9.3.7 does not honor the router's caseSensitive setting for path-scoped middleware. Its case-insensitive matching does not fold non-ASCII characters, while Fastify's router lowercases request paths with a Unicode-aware conversion that maps the KELVIN SIGN (U+212A) to the letter k (CWE-178). An unauthenticated remote attacker can reach a protected handler and skip middleware such as authentication when the application sets caseSensitive to false and protects a mount path containing the letter k.
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 does not honor the router's caseSensitive setting and matches path-scoped middleware mount paths with a case-insensitive regular expression that does not fold non-ASCII characters, while Fastify's router, when caseSensitive is set to false, lowercases the request path with a Unicode-aware conversion that maps the KELVIN SIGN character (U+212A) to the ASCII letter k. A request that spells a k in a protected mount path as the percent-encoded KELVIN SIGN is therefore routed to the protected handler while the middleware mounted on that path, such as authentication, authorization, or rate limiting, never matches and is skipped, letting an unauthenticated client reach the handler. Only applications that set caseSensitive to false and protect a mount path containing the letter k are affected. 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, or keep routing case-sensitive, which is the default.
Why it matters now
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
Remediation
Upgrade @fastify/middie to 9.3.7 or later. As a workaround, enforce authorization in a Fastify hook such as preHandler that runs after routing, or keep routing case-sensitive, which is the default.
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-94496 Path-scoped middleware bypass in @fastify/middie via duplicate slashesPriority LOW 22
Timeline
- 2026-11-19 Threatist record created from CVE-2026-132128
- 2026-11-19 CISA SSVC decision points changed
References
More fastify vulnerabilities
- 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
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences