External risk intelligence

@fastify/express Authentication Bypass Due to Middleware Path Mismatch

CVE advisorySeverity: CRITICAL (CVSS 9.1)

CVE-2026-129504

The vulnerability exists in a web framework middleware compatibility layer used to build web applications and APIs. Since these applications are commonly deployed as internet-facing services to handle web traffic, the vulnerable component is frequently exposed to the public internet in standard deployment patterns.

Halo Surface Signal: 4 out of 5 — likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

A security issue has been identified in a compatibility layer that allows Express middleware to run within the Fastify web framework. This vulnerability could potentially bypass authentication or authorization controls on protected routes, exposing them to unauthenticated access.

  • Middleware may not enforce access controls.
  • It affects common web application frameworks.
  • Confirm relevance and exposure of affected systems.

Attack Path

How an attacker could exploit the issue

Attackers can bypass authentication and authorization checks by exploiting how Express middleware is handled within the Fastify framework. This occurs when a path-scoped Express middleware, intended for security functions, is incorrectly configured due to string concatenation issues in the plugin's path merging. As a result, protected routes can become accessible to unauthenticated users because the middleware is skipped, despite the Fastify router still recognizing the route.

  • No authentication needed to start.
  • Unauthenticated access to protected routes.
  • Risk of unauthorized data access.

Live Threat

Current exploitation, exposure, and threat context

When an application uses path-scoped Express middleware for authentication or authorization within a prefixed plugin, protected routes could be exposed to unauthenticated clients due to a middleware routing mismatch. This affects string, array, and regular-expression mount paths.

  • Protected routes could be exposed.
  • Middleware could be silently skipped.
  • Unauthenticated access to protected resources.

Operational Fix

Recommended remediation, mitigation, and detection steps

This vulnerability impacts applications using @fastify/express, potentially exposing protected routes if Express middleware is configured with specific path prefixes. Application owners and platform teams should prioritize identifying all instances of @fastify/express, assessing their exposure, and planning upgrades to address the issue.

  • Application and platform teams own this issue.
  • Verify @fastify/express usage and route configurations.
  • Plan upgrades during the next maintenance window.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is @fastify/express?

@fastify/express is a bridge that allows developers to use Express.js middleware within the Fastify web framework. It is commonly used by teams that want to migrate to Fastify's performance-oriented architecture while retaining existing Express-based utility libraries for tasks like request logging, body parsing, or security enforcement.

How does CVE-2026-129504 cause a security failure?

This vulnerability involves CWE-436 (interpretation conflict) and CWE-863 (incorrect authorization). Because the plugin incorrectly merges URL paths, the Express middleware and the Fastify router disagree on where a route begins. This causes the middleware to be skipped entirely, leaving routes that rely on it for access control wide open to anyone.

Do I need to perform a complex attack to trigger this?

No. This is a configuration-based flaw, not one that requires a specific malicious payload or exploit technique. If your application uses path-scoped middleware inside a prefixed Fastify plugin, the bug is triggered by the way the paths are concatenated. It is not triggered if you are not using Express middleware or if your routes are defined at the root level without plugin prefixes.

How do I know if my systems are at risk?

According to Halo Surface Signal, this vulnerability is highly relevant if your web applications are internet-facing, which is the standard deployment pattern for this framework. You should identify any services using @fastify/express that handle authentication or authorization, as these are the primary targets for unintended access.

What is the recommended response to this CVE?

The most effective way to remediate this is to upgrade your @fastify/express dependency to version 4.0.10 or later. While planning the upgrade, you should audit your route configurations to identify where path-scoped middleware is used within plugins, as these specific locations are where your security controls may currently be failing.

References