CVE-2026-135270 in expressinfo

Summary

by MITRE • 11/26/2026

@fastify/express is the plugin that lets an application run Express middleware and Express applications inside the Fastify web framework. In versions from 4.0.5 before 4.0.14, a mount path that begins with an Express 5 optional leading segment written as a group is treated as relative and has a slash prepended when it is joined to the plugin prefix, which changes what the pattern matches so the middleware ends up mounted on a path that no longer corresponds to the real request paths. The middleware therefore never runs for requests that match the intended routes, while the Fastify routes still resolve to their handlers. An attacker can use this to bypass authentication or other middleware-based access controls on the affected routes. The issue is fixed in @fastify/express 4.0.14, and users should upgrade to 4.0.14 or later. As a workaround, mount the middleware on each path spelling explicitly, or enforce authentication in a Fastify hook such as preHandler that runs after the router resolves the request.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 11/26/2026

The @fastify/express plugin serves as a critical bridge allowing developers to integrate legacy Express middleware and applications within the modern Fastify web framework ecosystem. In versions ranging from 4.0.5 up to, but not including, version 4.0.14, a specific logic flaw exists in how mount paths are processed when they contain an optional leading segment formatted as a group, which is characteristic of Express 5 routing syntax. This vulnerability stems from incorrect path resolution mechanics where the plugin fails to correctly interpret relative path segments that begin with such optional groups. When these problematic paths are joined with the configured plugin prefix, the system erroneously prepends a forward slash character. This seemingly minor string manipulation fundamentally alters the resulting route pattern, causing it to diverge significantly from the actual request URI patterns generated by the underlying routing engines.

The operational impact of this path mismatch is severe because it creates a blind spot in security enforcement mechanisms that rely on middleware execution. Since the modified mount path no longer corresponds to real incoming request paths, the Express middleware attached at those locations never executes for requests targeting the intended routes. Consequently, any authentication checks, authorization logic, rate limiting, or input validation implemented within these Express middlewares are completely bypassed. While Fastify native routes continue to resolve and execute their handlers normally, they do so without the protective layer provided by the integrated middleware. This discrepancy allows an attacker to access protected resources or perform privileged actions simply by crafting requests that match the intended route patterns but fall outside the incorrectly mounted middleware scope due to the path prefix error.

From a security classification perspective, this vulnerability aligns with CWE-284 Improper Access Control and CWE-798 Use of Hard-coded Credentials if authentication is bypassed via credential stuffing or other means enabled by the lack of checks. It also maps to MITRE ATT&CK technique T1068 Exploitation for Privilege Escalation, as attackers can leverage this flaw to escalate privileges from unauthenticated users to authenticated roles or access restricted administrative endpoints. The root cause is a logic error in path normalization rather than an injection vulnerability, highlighting the importance of rigorous testing when integrating different web framework components that handle URL routing differently.

To mitigate this risk, organizations must upgrade the @fastify/express package to version 4.0.14 or later, where the path joining logic has been corrected to properly handle optional leading segments and ensure middleware mounts on the correct paths. For environments unable to immediately patch, a viable workaround involves explicitly mounting middleware on each specific path rather than relying on dynamic prefix joining, thereby ensuring exact match consistency between request URIs and middleware execution points. Alternatively, developers can enforce authentication and access controls using Fastify hooks such as preHandler. These hooks execute after the router has resolved the request but before the route handler runs, providing a more robust and framework-native security layer that is not susceptible to this specific path resolution flaw in external middleware integration.

Responsible

Openjs

Reservation

11/23/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00435

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!