CVE-2026-54281: Nest Middleware Bypass On Fastify Vulnerability

HIGH
Advisory Identifier: GHSA-6v32-fjc9-9qf6
CWE-863
Published
Advisory Summary

CVE-2026-54281 is a HIGH middleware bypass on fastify vulnerability (CWE-863: Incorrect Authorization) affecting Nest libraries in the npm ecosystem. The issue involves middleware bypass on fastify via trailing slash. Remediation is available by upgrading affected packages to version 11.1.24.

CVE-2026-54281 at a Glance

CVE Identifier CVE-2026-54281
GHSA Identifier GHSA-6v32-fjc9-9qf6
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-863: Incorrect Authorization
Affected Product Nest
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-54281

To remediate this vulnerability, upgrade all affected Nest dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@nestjs/platform-fastify fixed: 11.1.24
npm install @nestjs/platform-fastify@11.1.24
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @nestjs/platform-fastify

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-54281, inspect your project dependencies using npm:

npm ls @nestjs/platform-fastify

Analyze the terminal output to locate any version of Nest in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.1.24), your application is affected.

Note: The npm ls @nestjs/platform-fastify command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Nest, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact An authentication bypass vulnerability exists in `@nestjs/platform-fastify` (confirmed on version `11.1.24`, the latest available release at time of report). When middleware is registered through NestJS's `MiddlewareConsumer.forRoutes()` API on the Fastify adapter, an unauthenticated client can bypass the Nest middleware registered for that route by simply appending a trailing slash (`/`) to the request URL. This bypass works on the **default Fastify adapter configuration** — no special router options need to be enabled. Applications using the standard CRUD route shape (`GET /resource` and `GET /resource/:id`) are affected when they protect those routes with `MiddlewareConsumer.forRoutes()` middleware. ### Patches Fixed in `@nestjs/platform-fastify@11.1.24` ### References Kudos goes to @a-tt-om

CVE-2026-54281 Affected Nest Versions

1 component(s)
Fixed Versions:
11.1.24
Product / Package Ecosystem Affected Versions Fixed Version
@nestjs/platform-fastify
npm
< 11.1.24
11.1.24

References

Frequently Asked Questions

What is CVE-2026-54281?
CVE-2026-54281 is a security vulnerability in Nest involving Middleware Bypass on Fastify via Trailing Slash under CWE-863: Incorrect Authorization.
Which Nest versions are affected?
Affected versions include releases prior to 11.1.24 across affected packages: @nestjs/platform-fastify.
What version fixes CVE-2026-54281?
Upgrading to 11.1.24 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nestjs/platform-fastify affected?
Yes, @nestjs/platform-fastify is affected in releases prior to 11.1.24. Upgrade your dependency to 11.1.24 or later.
What CWE is associated with CVE-2026-54281?
CVE-2026-54281 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check npm dependencies for CVE-2026-54281?
Run the dependency tree command: 'npm ls @nestjs/platform-fastify'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6v32-fjc9-9qf6",
  "modified" : "2026-07-18T17:26:42Z",
  "published" : "2026-06-15T20:36:43Z",
  "aliases" : [ "CVE-2026-54281" ],
  "summary" : "Nest: Middleware Bypass on Fastify via Trailing Slash",
  "details" : "### Impact\n\nAn authentication bypass vulnerability exists in `@nestjs/platform-fastify` (confirmed on version `11.1.24`, the latest available release at time of report). When middleware is registered through NestJS's `MiddlewareConsumer.forRoutes()` API on the Fastify adapter, an unauthenticated client can bypass the Nest middleware registered for that route by simply appending a trailing slash (`/`) to the request URL.\n\nThis bypass works on the **default Fastify adapter configuration** — no special router options need to be enabled. Applications using the standard CRUD route shape (`GET /resource` and `GET /resource/:id`) are affected when they protect those routes with `MiddlewareConsumer.forRoutes()` middleware.\n\n### Patches\n\nFixed in `@nestjs/platform-fastify@11.1.24`\n\n### References\n\nKudos goes to @a-tt-om",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nestjs/platform-fastify"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.1.24"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 11.1.23"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nestjs/nest/security/advisories/GHSA-6v32-fjc9-9qf6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54281"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nestjs/nest"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-15T20:36:43Z",
    "nvd_published_at" : "2026-06-22T22:16:49Z"
  }
}