8.4High

CVE-2026-22031Fastify Middie Middleware Path Bypass

fastify middie Published: (9 months ago)

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.

Weakness (CWE): CWE-177

Data: CVE.org, NVD, CISA KEV, FIRST EPSS, Ubuntu. Published as the sources state it, in English.

Affected products and versions

VendorProductVersions
fastify fastify/middie < 9.1.0
fastify middie < 9.1.0

References and patches

CPE matches (NVD) (1)

  • cpe:2.3:a:fastify:fastify\/middie:*:*:*:*:*:node.js:*:* < 9.1.0