Packages / @nestjs/platform-fastify / Security

HighVulnerabilityGHSA-r4wm-x892-vjmxCVE-2026-2293Published 2 Mar 2026

Nest has a Fastify URL Encoding Middleware Bypass

Affected releases · @nestjs/platform-fastify

  • 11.x11.0.0 – 11.1.13Fixed in 11.1.14
  • 10.x10.0.0 – 10.4.22No fix on this line yet
  • 9.x and older6.0.0 – 9.4.3No fix, no longer updated

On 11.x, the newest line:

npm install @nestjs/platform-fastify@11.1.14
12.x
  1. Not affected

    12.0.0 – 12.2.0

    10 releases, latest

11.x
  1. Affected

    11.0.0 – 11.1.13

    36 releases

  2. Fixed

    11.1.14 – 11.2.7

    24 releases

10.x
  1. Affected

    10.0.0 – 10.4.22

    55 releases

9.x
  1. Affected

    9.0.0 – 9.4.3

    37 releases

8.x
  1. Affected

    8.0.0 – 8.4.7

    32 releases

7.x
  1. Affected

    7.0.0 – 7.6.18

    51 releases

6.x
  1. Affected

    6.0.0 – 6.11.11

    67 releases

312 stable releases of @nestjs/platform-fastify, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @nestjs/platform-fastify. It is read in your browser and sent nowhere.

What happens

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/platform-fastify@11.1.14

References

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