CVE-2026-54281: @nestjs/platform-fastify Middleware Bypass via Trailing Slash

@nestjs/platform-fastify Updated 23 Jun 2026

Summary

15/06/2026
Yes i
High
8.7

CVE-2026-54281: Nest: Middleware Bypass on Fastify via Trailing Slash. Affects @nestjs/platform-fastify versions < 11.1.24. Fixed in 11.1.24. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The @nestjs/platform-fastify package is a framework that allows developers to build server-side applications using the Fastify web framework within the NestJS ecosystem. It provides a robust set of features for building scalable and maintainable applications. However, a significant vulnerability has been identified that allows unauthenticated access to protected routes when a trailing slash is appended to the URL.

Vulnerability Detail

An authentication bypass vulnerability exists in the @nestjs/platform-fastify package, confirmed in version 11.1.24. When middleware is registered through NestJS's MiddlewareConsumer.forRoutes() API, an unauthenticated client can bypass the middleware by appending a trailing slash to the request URL. This issue affects applications using standard CRUD route shapes, such as GET /resource and GET /resource/:id, when those routes are protected with MiddlewareConsumer.forRoutes() middleware. The vulnerability is classified under CWE-863, indicating improper authorization.

How To Fix

Minimum fixed version

11.1.24

This is the first release that contains the fix.

npm install @nestjs/platform-fastify@11.1.24

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can implement additional validation in your middleware to check for trailing slashes and reject requests that do not meet your authentication criteria. For example, you could modify your middleware like this: function myMiddleware(req, res, next) { if (

req.url.endsWith('/')) { return res.status(403).send('Access denied');

} next(); }

Conclusion

The @nestjs/platform-fastify package has a critical vulnerability that allows unauthenticated access to protected routes through a simple URL manipulation. It is essential to update to the patched version 11.1.24 or implement a workaround to secure your application.

See every vulnerability recorded for @nestjs/platform-fastify →

Share this vulnerability

FAQ

The vulnerability allows unauthenticated users to bypass middleware protections, potentially exposing sensitive data or functionality.

Versions up to and including 11.1.23 are affected by this vulnerability.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without any signup.

The CVSS score for this vulnerability is 8.7, indicating a high severity level.

Implement a temporary workaround by adding validation in your middleware to handle trailing slashes appropriately.

Related vulnerabilities

Recent vulnerabilities recorded for @nestjs/platform-fastify.

How To Fix

Minimum fixed version

11.1.24

This is the first release that contains the fix.

npm install @nestjs/platform-fastify@11.1.24

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback