Vulnerability GHSA-r4wm-x892-vjmx

High Risk
HIGH RISK
CVSS Score: 8.0
Score Range: 7.0–8.9
High severity vulnerabilities (CVSS 7.0–8.9). Serious vulnerabilities that should be prioritized soon after critical fixes.
7 months ago
March 02, 2026 at 02:34 PM UTC
Nest has a Fastify URL Encoding Middleware Bypass
6.0.0-alpha.3 - 11.1.13
6.0.0-alpha.3 - 11.1.13

Summary

Nest has a Fastify URL Encoding Middleware Bypass

Details

Impact

What kind of vulnerability is it? Who is impacted?

A NestJS application using @nestjs/platform-fastify can allow bypass of any 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.

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, 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.

Patches

Fixed in @nestjs/[email protected]

References

Credit goes to Fluidattacks ( Cristian Vargas) https://fluidattacks.com/advisories/neton

Impacted packages

Timeline

Published
7 months ago
March 02, 2026 at 02:34 PM UTC
Fixed (11.1.14)
7 months ago
February 17, 2026 at 04:24 PM UTC
Last Modified
7 months ago
March 04, 2026 at 03:26 PM UTC