Skip to content

🚨 [security] Update @nestjs/platform-fastify 11.1.6 β†’ 11.1.17 (patch)#63

Closed
depfu[bot] wants to merge 1 commit into
mainfrom
depfu/update/pnpm/@nestjs/platform-fastify-11.1.17
Closed

🚨 [security] Update @nestjs/platform-fastify 11.1.6 β†’ 11.1.17 (patch)#63
depfu[bot] wants to merge 1 commit into
mainfrom
depfu/update/pnpm/@nestjs/platform-fastify-11.1.17

Conversation

@depfu
Copy link
Copy Markdown
Contributor

@depfu depfu Bot commented Mar 17, 2026


Welcome to Depfu πŸ‘‹

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ @​nestjs/platform-fastify (11.1.6 β†’ 11.1.17) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Nest Fastify HEAD Request Middleware Bypass

Impact

In a NestJS application using @nestjs/platform-fastify, GET middleware can be bypassed because Fastify automatically redirects HEAD requests to the corresponding GET handlers (if they exist).

As a result:

  • Middleware will be completely skipped.
  • The HTTP response won't include a body (since the response is truncated when redirecting a HEAD request to a GET handler).
  • The actual handler will still be executed.

Patches

Fixed in @nestjs/platform-fastify@11.1.16

🚨 Nest has a Fastify URL Encoding Middleware Bypass

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) https://fluidattacks.com/advisories/neton

🚨 Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU)

A NestJS application is vulnerable if it meets all of the following criteria:

  1. Platform: Uses @nestjs/platform-fastify.
  2. Security Mechanism: Relies on NestMiddleware (via MiddlewareConsumer) for security checks (authentication, authorization, etc.), or through app.use()
  3. Routing: Applies middleware to specific routes using string paths or controllers (e.g., .forRoutes('admin')).
    Example Vulnerable Config:
// app.module.ts
export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer
      .apply(AuthMiddleware) // Security check
      .forRoutes('admin');   // Vulnerable: Path-based restriction
  }
}

Attack Vector:

  • Target Route: /admin
  • Middleware Path: admin
  • Attack Request: GET /%61dmin
  • Result: Middleware is skipped (no match on %61dmin), but controller for /admin is executed.

Consequences:

  • Authentication Bypass: Unauthenticated users can access protected routes.
  • Authorization Bypass: Restricted administrative endpoints become accessible to lower-privileged users.
  • Input Validation Bypass: Middleware performing sanitization or validation can be skipped.

Patches

Patched in @nestjs/platform-fastify@11.1.11

Resources

Credit goes to Hacktron AI for reporting this issue.

Release Notes

11.1.17

v11.1.17 (2026-03-16)

Enhancements

  • microservices

Bugs

  • platform-fastify
    • auto-run middleware for HEAD requests as fastify redirects them to GET handlers (effectively skipping middleware execution) cbdf737 (@kamilmysliwiec)

Dependencies

Committers: 3

11.1.16

v11.1.16 (2026-03-05)

Bug fixes

  • microservices
    • #16506 fix(microservices): fix double callback when isdisposed or err is truthy (@LhonRafaat)

Dependencies

Committers: 2

11.1.15

What's Changed

  • fix(microservices): if indexOf return 0 will if will be falsy by @cuiweixie in #16401
  • fix(microservices): introuduce max pattern depth and object complexity by @kamilmysliwiec in #16402
  • chore(@nestjs/core): allow override for initializeWildcardHandlersIfE… by @StNekroman in #16468
  • chore(deps): update dependency @fastify/middie to v9.2.0 [security] by @renovate[bot] in #16472
  • fix(deps): update dependency multer to v2.1.0 [security] by @renovate[bot] in #16474

New Contributors

Full Changelog: v11.1.14...v11.1.15

11.1.14

v11.1.14 (2026-02-17)

Bug fixes

Enhancements

Committers: 5

11.1.13

v11.1.13 (2026-02-03)

Bug fixes

  • common
    • #16230 fix(common): Fix skipping maxArrayLength and maxStringLength option (@chojs23)

Enhancements

Dependencies

Committers: 6

11.1.12

v11.1.12 (2026-01-15)

Bug fixes

  • common

Dependencies

Committers: 3

11.1.11

v11.1.11 (2025-12-29)

Bug fixes

  • platform-fastify
  • core
    • #16133 fix(core): add missing catch handler for forward-ref provider resolution (@coti-z)

Dependencies

Committers: 3

11.1.10

v11.1.10 (2025-12-22)

Bug fixes

  • core
    • #16098 fix(core): instantiate nested transient providers in static context (@mag123c)
    • #16005 fix(core): resolve all providers when using resolve() with each option (@malkovitc)
  • microservices
    • #16072 fix(microservices): fix grpc stream method return type (@shash-hq)
  • common

Enhancements

Dependencies

Committers: 11

11.1.9

v11.1.9 (2025-11-14)

Bug fixes

  • core
    • #15865 fix(core): make get() throw for implicitly request-scoped trees (@JoeNutt)

Enhancements

Dependencies

Committers: 4

11.1.8

v11.1.8 (2025-10-27)

Bug fixes

  • core
    • #15815 fix(core): ensure nested transient provider isolation (@mag123c)
  • platform-fastify

Committers: 2

11.1.7

v11.1.7 (2025-10-21)

Bug fixes

  • microservices
  • platform-fastify
    • #15732 fix: correct parameter type in RouteConstraints decorator (@thedv91)
  • core
    • #15571 fix(core): skip lifecycle hooks for non-instantiated transient services (@mag123c)
  • common

Enhancements

  • common, platform-socket.io, websockets
  • common
    • #15705 fix(core): resolve extras in configurable module builder async methods (@mag123c)
  • common, core
    • #15503 feat(common): add force-console option to console logger (@mag123c)
  • core
    • #15588 fix(core): improve dependency resolution error messages (@at7211)
  • microservices
    • #15598 feat(errors): add InvalidTcpDataReceptionException for handling TCP receive errors​ (@ghyghoo8)

Dependencies

Committers: 9

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu Bot added the depfu label Mar 17, 2026
@depfu depfu Bot requested a review from microwavekonijn March 17, 2026 20:05
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 17, 2026

⚠️ No Changeset found

Latest commit: 64ebf70

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@depfu
Copy link
Copy Markdown
Contributor Author

depfu Bot commented May 12, 2026

Closing because this update has already been applied

@depfu depfu Bot closed this May 12, 2026
@depfu depfu Bot deleted the depfu/update/pnpm/@nestjs/platform-fastify-11.1.17 branch May 12, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants