CVE-2026-135270 - @fastify/express vulnerable to middleware bypass via mount paths starting with an optional group

Vulnerability · Reported by NVD · · CWE-436, CWE-863

Severity
High Risk score 74/100
CVSS
7.4 v3.1 · from NVD
Exploit chance (EPSS)
0.43% Higher than 29% of CVEs
Known exploited
No Not in CISA KEV

Summary

@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.

How this vulnerability can be exploited

An attacker can exploit this vulnerability remotely over the network, without any login, and without any action from a user. Attack complexity is high, meaning specific conditions must exist first. If successful, the attacker could read sensitive data and modify data or code.

Is it being exploited?

The EPSS model estimates a 0.43% chance this CVE will be exploited in the next 30 days, which is low and higher than 29% of all published CVEs.

Patch priority and what to do

Patch as soon as possible, ideally within days. It is remotely reachable or critical severity, so exposure to the internet greatly increases risk. 1) Check whether you run the affected product and version. 2) Apply the vendor update or patch listed in the advisory. 3) Until patched, restrict network access to the service (firewall, VPN, WAF rules). 4) Review logs for signs of exploitation since the publication date.

CVSS vector

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

See what each part means in the official CVSS calculator ↗

Tags

CVE-2026-135270

Sources & references

How this data is collected: methodology & sources.

Run this software? Get free alerts for new vulnerabilities →

Need to block attackers? Free hourly IOC blocklists (IPs, domains, URLs, hashes) →

Open the live threat dashboard →

Subscribe via RSS.