# GHSA-6RMC-F24G-HMP6: @fastify/express vulnerable to path-scoped middleware bypass via Unicode case folding

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

## Tracked as

- [CVE-2026-129850](https://cve.now/CVE-2026-129850.md): Fastify Express path-scoped middleware bypass in case-insensitive routing

## Affected versions

- @fastify/express (npm): from 4.0.0, fixed in 4.0.10

## Description

### Impact

When Fastify routing is case-insensitive (`routerOptions.caseSensitive: false`), find-my-way folds the request path with `toLowerCase()`, which maps the Unicode character U+212A KELVIN SIGN to the ASCII letter `k`. `@fastify/express` passes Express the decoded path without applying that folding, and Express matches mount paths with a case-insensitive regular expression that does not fold non-ASCII characters. The two disagree, so 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/express` `4.0.10` or later. The request path Express matches path-scoped middleware on is now folded with the same `toLowerCase()` the router uses when `caseSensitive` is `false`.

### Workarounds

Enforce authorization in a Fastify hook (such as `preHandler`) that runs after the router has resolved the request, rather than relying solely on a path-scoped Express middleware. Leaving routing case-sensitive (the default) also avoids the issue.

## References

- https://github.com/fastify/fastify-express/security/advisories/GHSA-6rmc-f24g-hmp6

Page: https://cve.now/GHSA-6RMC-F24G-HMP6
