AploSec / Disclosures / CVE-2026-129504

Critical 9.1ReportedFixed in 4.0.10CWE-436Multiple credited contributorsnpm

@fastify/express vulnerable to path-scoped middleware bypass via prefix and mount path join mismatch

CVE-2026-129504 · published 2026-11-21

Summary

CVE-2026-129504 affects @fastify/express (npm) 4.0.0 before 4.0.10: Auth middleware bypass via prefix and mount path join (CWE-436). Fixed in 4.0.10. CVSS 3.1 base score 9.1 (Critical), assigned by OpenJS Foundation. Published 2026-11-21 by openjs. Credit: eliteaja11-dev, mcollina, UlisesGascon, hwi-yong, zachariah-mithani.

@fastify/express is a compatibility layer that lets Express middleware run inside the Fastify web framework. In versions 4.0.0 through 4.0.9, the plugin joins a path-scoped middleware's mount path to the Fastify plugin prefix by string concatenation, so when the plugin prefix ends with a slash or the mount path omits its leading slash, the resulting Express mount path does not line up with the route the Fastify router serves. Express then fails to match and passes the request on while the Fastify router still dispatches the route, so the middleware is silently skipped. An application that uses path-scoped Express middleware for authentication or authorization inside a prefixed plugin can expose protected routes to unauthenticated clients, with no crafted request and no non-default option required, and string, array, and regular-expression mount paths are all affected. The issue is fixed in @fastify/express 4.0.10, and users should upgrade to 4.0.10 or later.

Evidence

Reported to the maintainer. The public advisory and references below describe the evidence and preconditions; reporting status alone does not establish independent reproduction.

Remediation

Upgrade @fastify/express to 4.0.10 or later. Releases in the affected range (4.0.0 before 4.0.10) are vulnerable. See the linked advisory for details on affected release lines.

Timeline

  • 2026-11-21 CVE published

References

Severity
Critical 9.1CVSS 3.1, scored by OpenJS Foundation in the CVE record
Package
@fastify/express
Ecosystem
npm
Affected
4.0.0 before 4.0.10
Fixed
4.0.10
Weakness
CWE-436
CNA
openjs
Credit
eliteaja11-devreportermcollinaremediation developerUlisesGasconremediation reviewerhwi-yongfinderzachariah-mithanifinder