CVE-2026-2880: @fastify/middie @fastify/middie Has Improper Path Normalization Vulnerability

HIGH
Advisory Identifier: GHSA-8p85-9qpw-fwgw
CWE-20
Published
Advisory Summary

CVE-2026-2880 is a HIGH @fastify/middie has improper path normalization vulnerability (CWE-20: Improper Input Validation) affecting @fastify/middie libraries in the npm ecosystem. The issue involves @fastify/middie has improper path normalization when using path-scoped middleware. Remediation is available by upgrading affected packages to version 9.2.0.

CVE-2026-2880 at a Glance

CVE Identifier CVE-2026-2880
GHSA Identifier GHSA-8p85-9qpw-fwgw
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product @fastify/middie
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-2880

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

@fastify/middie fixed: 9.2.0
npm install @fastify/middie@9.2.0
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 @fastify/middie

How to Check if You Are Affected

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

npm ls @fastify/middie

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

Note: The npm ls @fastify/middie 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In @fastify/middie, 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

## Summary A path normalization inconsistency in `@fastify/middie` can result in authentication/authorization bypass when using path-scoped middleware (for example, `app.use('/secret', auth)`). When Fastify router normalization options are enabled (such as `ignoreDuplicateSlashes`, `useSemicolonDelimiter`, and related trailing-slash behavior), crafted request paths may bypass middleware checks while still being routed to protected handlers. ## Impact An unauthenticated remote attacker can access endpoints intended to be protected by middleware-based auth/authorization controls by sending specially crafted URL paths (for example, `//secret` or `/secret;foo=bar`), depending on router option configuration. This may lead to unauthorized access to protected functionality and data exposure. ## Affected versions - Confirmed affected: `@fastify/middie@9.1.0` - All versions prior to the patch are affected. ## Patched versions - Fixed in: *9.2.0* ## Details The issue is caused by canonicalization drift between: 1. `@fastify/middie` path matching for `app.use('/prefix', ...)`, and 2. Fastify/find-my-way route lookup normalization. Because middleware and router did not always evaluate the same normalized path, auth middleware could be skipped while route resolution still succeeded. ## Workarounds Until patched version is deployed: - Avoid relying solely on path-scoped middie guards for auth/authorization. - Enforce auth at route-level handlers/hooks after router normalization. - Disable risky normalization combinations only if operationally feasible. ## Resources - Fluid Attacks Disclosure Policy: https://fluidattacks.com/advisories/policy - Fluid Attacks advisory URL: https://fluidattacks.com/advisories/jimenez ## Credits - **Cristian Vargas** (Fluid Attacks Research Team) — discovery and report. - **Oscar Uribe** (Fluid Attacks) — coordination and disclosure.

CVE-2026-2880 Affected @fastify/middie Versions

1 component(s)
Fixed Versions:
9.2.0
Product / Package Ecosystem Affected Versions Fixed Version
@fastify/middie
npm
< 9.2.0
9.2.0

References

Frequently Asked Questions

What is CVE-2026-2880?
CVE-2026-2880 is a security vulnerability in @fastify/middie involving @fastify/middie has Improper Path Normalization when Using Path-Scoped Middleware under CWE-20: Improper Input Validation.
Which @fastify/middie versions are affected?
Affected versions include releases prior to 9.2.0 across affected packages: @fastify/middie.
What version fixes CVE-2026-2880?
Upgrading to 9.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @fastify/middie affected?
Yes, @fastify/middie is affected in releases prior to 9.2.0. Upgrade your dependency to 9.2.0 or later.
What CWE is associated with CVE-2026-2880?
CVE-2026-2880 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2026-2880?
Run the dependency tree command: 'npm ls @fastify/middie'. 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-8p85-9qpw-fwgw",
  "modified" : "2026-02-28T02:47:17Z",
  "published" : "2026-02-28T02:47:17Z",
  "aliases" : [ "CVE-2026-2880" ],
  "summary" : "@fastify/middie has Improper Path Normalization when Using Path-Scoped Middleware",
  "details" : "## Summary\nA path normalization inconsistency in `@fastify/middie` can result in authentication/authorization bypass when using path-scoped middleware (for example, `app.use('/secret', auth)`).\n\nWhen Fastify router normalization options are enabled (such as `ignoreDuplicateSlashes`, `useSemicolonDelimiter`, and related trailing-slash behavior), crafted request paths may bypass middleware checks while still being routed to protected handlers.\n\n## Impact\nAn unauthenticated remote attacker can access endpoints intended to be protected by middleware-based auth/authorization controls by sending specially crafted URL paths (for example, `//secret` or `/secret;foo=bar`), depending on router option configuration.\n\nThis may lead to unauthorized access to protected functionality and data exposure.\n\n## Affected versions\n- Confirmed affected: `@fastify/middie@9.1.0`\n- All versions prior to the patch are affected.\n\n## Patched versions\n- Fixed in: *9.2.0*\n\n## Details\nThe issue is caused by canonicalization drift between:\n1. `@fastify/middie` path matching for `app.use('/prefix', ...)`, and\n2. Fastify/find-my-way route lookup normalization.\n\nBecause middleware and router did not always evaluate the same normalized path, auth middleware could be skipped while route resolution still succeeded.\n\n## Workarounds\nUntil patched version is deployed:\n- Avoid relying solely on path-scoped middie guards for auth/authorization.\n- Enforce auth at route-level handlers/hooks after router normalization.\n- Disable risky normalization combinations only if operationally feasible.\n\n## Resources\n- Fluid Attacks Disclosure Policy: https://fluidattacks.com/advisories/policy\n- Fluid Attacks advisory URL: https://fluidattacks.com/advisories/jimenez\n\n## Credits\n- **Cristian Vargas** (Fluid Attacks Research Team) — discovery and report.\n- **Oscar Uribe** (Fluid Attacks) — coordination and disclosure.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@fastify/middie"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fastify/middie/security/advisories/GHSA-8p85-9qpw-fwgw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-2880"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/middie/commit/140e0dd0359d890fec7e6ea1dcc5134d6bd554d4"
  }, {
    "type" : "WEB",
    "url" : "https://fluidattacks.com/advisories/jimenez"
  }, {
    "type" : "WEB",
    "url" : "https://fluidattacks.com/advisories/policy"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fastify/middie"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/middie/releases/tag/v9.2.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-28T02:47:17Z",
    "nvd_published_at" : "2026-02-27T19:16:12Z"
  }
}