Skip to content
DayZeroHub
Critical CVSS 9.1CVE-2026-124626

@fastify/express: middleware bypass via empty route parameters and wildcards (CVE-2026-124626)

@fastify/express @fastify/express

Summary

In @fastify/express 4.0.5 through 4.0.9, a request with an empty dynamic segment can run a Fastify route handler while the Express middleware mounted on that pattern is skipped. The source assigns a CVSS 3.1 score of 9.1 (critical severity) and states a fix in version 4.0.10.

What happened

@fastify/express is a compatibility layer that lets Express middleware run inside Fastify. In versions 4.0.5 through 4.0.9, the plugin matches path-scoped Express middleware with a matcher that requires a non-empty value for a dynamic segment, while Fastify's router accepts an empty parameter or wildcard value. When a route and an Express middleware mount share a dynamic pattern, a request with an empty segment matches the Fastify route and runs the handler, but the middleware mounted on that pattern is skipped. On a scoped mount, an unauthenticated request could reach a protected handler. No special configuration is required. The associated weaknesses are CWE-287 and CWE-436.

Why it matters

Skipping the middleware may allow unauthenticated requests to reach handlers that rely on it for protection. The source states that the practical impact depends on what the empty value selects in each application. The CVSS 3.1 score is 9.1 (vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N, assigned by CNA:openjs) and severity is critical. According to CISA's KEV catalog, no known exploitation is recorded; the source provides no evidence of active exploitation.

Affected products and versions

@fastify/express, versions >= 4.0.5 and < 4.0.10 (affected). Version 4.0.10 is listed as unaffected.

ProductVersionsFixed in
@fastify/express @fastify/express>= 4.0.5, < 4.0.10—
@fastify/express @fastify/express4.0.104.0.10

Action recommended by the source

The vendor recommends upgrading to @fastify/express 4.0.10 or later. The source does not state any other mitigations.

Fixed in: 4.0.10

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-287, CWE-436

Relevant change history

  1. Advisory correction

    The preliminary version was replaced by the full write-up.

  2. Published

    Preliminary advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources