Description
@fastify/middie is the plugin that adds middleware support on steroids to Fastify. A security vulnerability exists in @fastify/middie prior to version 9.1.0 where middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g., `/%61dmin` instead of `/admin`). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints. Version 9.1.0 fixes the issue.
Published: 2026-01-19
Score: 8.4 High
EPSS: < 1% Very Low
KEV: No
Impact: Authentication Bypass / Unauthorized Access
Action: Immediate Patch
AI Analysis

Impact

@fastify/middie allows a middleware registered on a path prefix to be bypassed when an attacker uses URL‑encoded characters in that prefix, such as %61 for "a". The middleware engine incorrectly rejects the encoded path and skips execution, while the Fastify router decodes the URL and still delivers the intended route handler. This flaw permits attackers to reach endpoints that rely on middie middleware for authentication or authorization, effectively allowing unauthorized access without executing the protected logic. The weakness is classified as CWE‑177, fall‑through logic leading to an unintended code path.

Affected Systems

The vulnerability affects all installations of the @fastify/middie plugin built before version 9.1.0, regardless of the Fastify core version. Users of the plugin should verify their package.json or lockfile to ensure the dependency is updated to v9.1.0 or later.

Risk and Exploitability

With a CVSS score of 8.4 and an EPSS below 1%, the vulnerability is rated high severity but expected exploitation is currently low. It is not listed in the CISA KEV catalog, indicating no confirmed exploits yet. An attacker can exploit the flaw remotely by crafting a URL that includes a percent‑encoded character in a protected path prefix. No local privileges or specific configuration are required beyond having an exposed Fastify server that uses middie for route protection. The attack is straightforward and requires no authentication to initiate the request.

Generated by OpenCVE AI on April 18, 2026 at 05:12 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade @fastify/middie to version 9.1.0 or later immediately.
  • If upgrading is not yet possible, remove middie from routes that enforce critical access controls or add an additional authentication layer that operates after middie processing so that bypassed middleware does not grant access.
  • Disable the use of percent‑encoding in protected path prefixes by normalizing incoming URLs before they reach middie, or configure your application to reject encoded characters in path segments until middie can process them.

Generated by OpenCVE AI on April 18, 2026 at 05:12 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-cxrg-g7r8-w69p Fastify Middie Middleware Path Bypass
History

Fri, 13 Mar 2026 14:45:00 +0000

Type Values Removed Values Added
First Time appeared Openjsf
Openjsf \@fastify\/middie
CPEs cpe:2.3:a:openjsf:\@fastify\/middie:*:*:*:*:*:fastify:*:*
Vendors & Products Openjsf
Openjsf \@fastify\/middie

Tue, 20 Jan 2026 15:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 20 Jan 2026 08:45:00 +0000

Type Values Removed Values Added
First Time appeared Fastify
Fastify fastify
Vendors & Products Fastify
Fastify fastify

Mon, 19 Jan 2026 15:45:00 +0000

Type Values Removed Values Added
Description @fastify/middie is the plugin that adds middleware support on steroids to Fastify. A security vulnerability exists in @fastify/middie prior to version 9.1.0 where middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g., `/%61dmin` instead of `/admin`). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints. Version 9.1.0 fixes the issue.
Title Fastify Middie Middleware Path Bypass
Weaknesses CWE-177
References
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L'}


Subscriptions

Fastify Fastify
Openjsf \@fastify\/middie
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-01-20T14:45:31.487Z

Reserved: 2026-01-05T22:30:38.718Z

Link: CVE-2026-22031

cve-icon Vulnrichment

Updated: 2026-01-20T14:45:24.914Z

cve-icon NVD

Status : Analyzed

Published: 2026-01-19T16:15:54.310

Modified: 2026-03-13T14:40:56.480

Link: CVE-2026-22031

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T05:15:15Z

Weaknesses