@fastify/express vulnerable to middleware bypass via empty route parameters and wildcards
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| @fastify/express@fastify/express |
≥ 4.0.5, < 4.0.10→ 4.0.10 |
4.0.10 |
Original description The description as published by the source.
@fastify/express is a compatibility layer that lets Express middleware run inside the Fastify web framework. In versions 4.0.5 through 4.0.9, the plugin matches path-scoped Express middleware with a matcher that requires a non-empty value for a dynamic segment, while Fastify's router accepts an empty parameter or wildcard value. When a route and an Express middleware mount share a dynamic pattern, a request with an empty segment matches the Fastify route and runs the handler while the middleware mounted on that pattern is skipped, so on a scoped mount an unauthenticated request can reach a protected handler. No special configuration is required, and the practical impact depends on what the empty value selects in the application. The issue is fixed in @fastify/express 4.0.10, and users should upgrade to 4.0.10 or later.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory cna.openjsf.org
- advisory github.com
- advisory nvd.nist.gov