CVE-2026-135280 in fastify-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 before 4.0.14, when an application enables case-insensitive routing, middleware mounted on a path can still be skipped in two cases: a string mount path or plugin prefix containing a Unicode character whose case folding differs from a plain lowercase conversion fails to match the lowercased request path, and a matcher that stays case-sensitive inside an Express Router or application, such as a regular expression without the ignore-case flag or an explicitly case-sensitive router, only matches its own casing. In both cases a request reaches the Fastify route handler while the path-scoped middleware does not run. An attacker can use this to bypass authentication or other middleware-based access controls on the affected routes, and only applications that enable case-insensitive routing are affected. The issue is fixed in @fastify/express 4.0.14, and users should upgrade to 4.0.14 or later. As a workaround, enforce authentication in a Fastify hook such as preHandler that runs after routing, avoid such Unicode characters in mount paths, and match case-insensitively inside Express routers and applications.

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 an integration layer allowing developers to run Express middleware and entire Express applications within the Fastify web framework environment. This capability is particularly useful for legacy code migration or leveraging specific Express ecosystem utilities that are not natively available in Fastify. However, a critical logic flaw exists in versions prior to 4.0.14 when the application enables case-insensitive routing. The vulnerability stems from an inconsistency between how the underlying router matches request paths and how it executes mounted middleware. Specifically, the plugin fails to correctly synchronize path matching with middleware execution under certain conditions involving Unicode characters or explicit case-sensitivity settings within nested Express routers.

The technical flaw manifests in two distinct scenarios where a request successfully reaches the Fastify route handler but bypasses the intended path-scoped middleware. The first scenario involves mount paths or plugin prefixes containing Unicode characters whose case folding behavior differs from standard ASCII lowercase conversion. When such characters are present, the routing mechanism may match the request due to case-insensitive configuration, yet the middleware execution logic fails to recognize this match because it relies on a simpler lowercasing process that does not account for complex Unicode equivalence rules. Consequently, the middleware is skipped entirely despite the route being considered valid by the router.

The second scenario occurs when an Express Router or application within the stack maintains case-sensitive matching behavior, such as through regular expressions lacking the ignore-case flag or routers explicitly configured to be case-sensitive. In these instances, even if the outer Fastify layer performs case-insensitive routing and matches a request, the inner Express component may reject the path match based on its own strict casing rules. This mismatch results in the same outcome: the request proceeds to the final handler without triggering any middleware defined for that specific path scope within the Express context.

From an operational perspective, this inconsistency creates a significant security gap related to access control and authentication bypasses. Since many applications rely on mounted middleware to enforce authentication checks, rate limiting, or input validation before reaching the core business logic handlers, skipping these middlewares allows unauthenticated or malicious requests to execute protected functionality directly. An attacker can exploit this by crafting URLs that utilize specific Unicode characters or casing variations that trigger the mismatch condition, effectively circumventing security controls intended for those routes. This vulnerability is classified under CWE-284 Improper Access Control and aligns with ATT&CK techniques related to privilege escalation or bypassing authentication mechanisms via path manipulation.

The issue has been resolved in version 4.0.14 of the @fastify/express package, which corrects the synchronization logic between routing matches and middleware execution for both Unicode handling and nested case-sensitive routers. Users are strongly advised to upgrade immediately if they rely on this plugin with case-insensitive routing enabled. For organizations unable to patch instantly, several mitigations can reduce risk. One effective workaround is to enforce authentication and critical security checks in a Fastify hook such as preHandler, which executes after the routing decision but before the handler runs, ensuring that middleware bypasses do not compromise core security logic. Additionally, developers should avoid using Unicode characters with ambiguous case-folding properties in mount paths or plugin prefixes. Finally, when integrating Express routers, it is prudent to ensure they are configured for case-insensitive matching if the parent Fastify application expects such behavior, thereby eliminating the mismatch that leads to middleware skipping.

Responsible

Openjs

Reservation

11/23/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00435

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!