Fastify Express Plugin Middleware Bypass (CVE-2026-133120)

A critical vulnerability in @fastify/express before 4.0.10 allows an unauthenticated attacker to bypass path-scoped Express middleware (e.g., authentication, authorization, rate limiting) due to a URL/path mismatch between Fastify's router and the Express compatibility layer. Upgrade to 4.0.10 or later immediately.

Overview

CVE-2026-133120 affects @fastify/express, a compatibility layer that allows Express middleware to run inside Fastify. In versions prior to 4.0.10, the plugin passes Express a request URL that does not always match the path Fastify's router dispatched. This mismatch can cause path-scoped Express middleware to be skipped while the route handler still executes.

Several request forms trigger the mismatch, including: - Percent-decoding that rewrites a backslash to a slash or double-decodes an encoded percent sign. - A request target that begins with an asterisk (*).

As a result, middleware and handler disagree on the path or on parameter/query values. An unauthenticated client can reach a handler that was intended to be protected by authentication, authorization, or rate-limiting middleware, with no special configuration required.

Affected Versions

- Vulnerable: All versions before 4.0.10 - Fixed: 4.0.10 and later

Impact

This is a critical security issue because it can lead to unauthorized access to protected endpoints, bypassing security controls. The attack requires no authentication and can be performed remotely.

References

- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-133120 - OpenJS Foundation advisory: https://cna.openjsf.org/security-advisories.html - GitHub Security Advisory: https://github.com/fastify/fastify-express/security/advisories/GHSA-w877-hjcp-88rc

What to do

1. Upgrade immediately to @fastify/express version 4.0.10 or later. This is the only complete fix. 2. Audit your middleware usage – identify any Express middleware that is path-scoped (e.g., app.use('/admin', auth)) and verify it is not being bypassed. 3. Review logs for suspicious requests that might indicate exploitation attempts, especially those with unusual URL encoding or asterisk-prefixed targets. 4. If you cannot upgrade immediately , consider adding an additional layer of security (e.g., a Fastify-level hook or reverse proxy rule) to enforce the same path-based checks, but note that this is a temporary mitigation and upgrade is strongly recommended. 5. Verify the vendor advisory before making production changes, and confirm your exact version and upgrade path.

Sources