# GHSA-R5H5-R25J-5VHR: @fastify/middie vulnerable to path-scoped middleware bypass via Unicode case folding

- Database: GitHub
- Severity: CVSS 7.4 (High)
- Published: 2026-11-18
- Modified: 2026-11-18

## Tracked as

- [CVE-2026-132128](https://cve.now/CVE-2026-132128.md): Fastify Middie path-scoped middleware bypass via Unicode case folding

## Affected versions

- @fastify/middie (npm): fixed in 9.3.7

## Description

### Impact

`@fastify/middie` versions `<= 9.3.6` do not read `routerOptions.caseSensitive` and match path-scoped middleware mount paths with a case-insensitive regular expression that does not fold non-ASCII characters. When routing is case-insensitive (`caseSensitive: false`), Fastify's router folds the request path with `toLowerCase()`, which maps the Unicode character U+212A KELVIN SIGN to the ASCII letter `k`, while the middleware does not. The two layers disagree on the canonical request path: a request such as `/api/%E2%84%AAeys` is routed to the `/api/keys` handler while a path-scoped middleware mounted at `/api/keys` (authentication, authorization, rate limiting) never matches and is skipped. An unauthenticated client reaches the protected handler by spelling a `k` in the mount path as `%E2%84%AA`. Only a mount path containing `k` is affected, and only when the application enables `caseSensitive: false`.

### Patches

Upgrade to `@fastify/middie` v9.3.7 or later.

### Workarounds

Enforce authorization in a Fastify hook (such as `preHandler`) that runs after the router has resolved the request. Leaving routing case-sensitive (the default) also avoids the issue.

## References

- https://github.com/fastify/middie/security/advisories/GHSA-r5h5-r25j-5vhr

Page: https://cve.now/GHSA-R5H5-R25J-5VHR
