# GHSA-56JQ-34PF-P873: @fastify/middie vulnerable to path-scoped middleware bypass via duplicate-slash mount path

- Database: GitHub
- Severity: CVSS 4.8 (Medium)
- Published: 2026-11-18
- Modified: 2026-11-18

## Tracked as

- [CVE-2026-132133](https://cve.now/CVE-2026-132133.md): Fastify Middie middleware bypass via doubled slashes in mount paths

## Affected versions

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

## Description

### Impact

`@fastify/middie` builds each path-scoped middleware's match regular expression from its mount path without collapsing duplicate slashes, even when the application enables Fastify's `routerOptions.ignoreDuplicateSlashes`. Fastify's router collapses duplicate slashes in both the registered route and the request path under that option, so a route registered at `/admin//secret` is served at `/admin/secret`, but the middleware's compiled match still requires the doubled slash and matches no request the router serves. A path-scoped middleware (authentication, authorization, rate limiting) is therefore skipped while the router dispatches the request to the handler. An application is affected when it enables `ignoreDuplicateSlashes` and a middleware's mount path reaches middie with a duplicate slash, most commonly by joining a plugin prefix that ends in `/` to a mount path that starts with `/`, for example `register(plugin, { prefix: '/api//v1/' })`. No authentication is required.

### 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. Avoid mount paths and plugin prefixes that introduce duplicate slashes.

## References

- https://github.com/fastify/middie/security/advisories/GHSA-56jq-34pf-p873

Page: https://cve.now/GHSA-56JQ-34PF-P873
