# GHSA-F446-H93M-FVR5: @fastify/express vulnerable to middleware bypass with case-insensitive routing via Unicode mount paths and case-sensitive matchers

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

## Tracked as

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

## Affected versions

- @fastify/express (npm): fixed in 4.0.14

## Description

### Impact

With `routerOptions.caseSensitive: false`, Fastify's router (find-my-way) lowercases the request path with `toLowerCase()` and routes a request whatever its spelling. To mirror that, `@fastify/express` 4.0.10 lowercases the path it hands to Express and adds the `i` flag to RegExp mount paths ([GHSA-6rmc-f24g-hmp6](https://github.com/fastify/fastify-express/security/advisories/GHSA-6rmc-f24g-hmp6)). Two kinds of path-scoped middleware are still skipped.

- Express matches a string mount path with the `i` flag of a regular expression, which does not fold every character as `toLowerCase()` does: `İ` (U+0130) becomes `i̇`, `ẞ` (U+1E9E) becomes `ß`, and `K` (U+212A), `Ω` (U+2126) and `Å` (U+212B) become ASCII or other letters. A mount path or plugin prefix containing such a character, such as `fastify.use('/İletişim/admin', auth)`, does not match the lowercased path, so with 4.0.10 every request to the routes below it skips the middleware. Earlier versions are bypassed by a request spelled in lowercase.
- Matching inside an Express Router or application passed to `fastify.use()` can still be case-sensitive: a RegExp mount path without the `i` flag, a `Router({ caseSensitive: true })`, or an application with `case sensitive routing` enabled. Such a mount only matches its own casing, so `GET /admin/users` runs the handler for `/Admin/users` while `router.use(/^\/Admin/, auth)` is skipped, and since 4.0.10 lowercases the path, so is `GET /Admin/users`.

Only applications that set `caseSensitive: false` are affected.

### Patches

Upgrade to `@fastify/express` 4.0.14 or later. String mount paths are lowercased as the request path is, and a request that a case-sensitive matcher would match in the route's own spelling fails with a 500 instead of skipping the middleware.

### Workarounds

Enforce authentication in a Fastify hook (such as `preHandler`) that runs after the router has resolved the request, avoid characters such as `İ` and `ẞ` in mount paths, and match case-insensitively inside Express routers and applications (add the `i` flag to RegExp mount paths and do not enable `caseSensitive` or `case sensitive routing`).

### References

- [GHSA-6rmc-f24g-hmp6](https://github.com/fastify/fastify-express/security/advisories/GHSA-6rmc-f24g-hmp6) (CVE-2026-129850), the original case-folding bypass

## References

- https://github.com/fastify/fastify-express/security/advisories/GHSA-f446-h93m-fvr5

Page: https://cve.now/GHSA-F446-H93M-FVR5

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
