Description
@fastify/express v4.0.4 and earlier contains a path handling bug in the onRegister function that causes middleware paths to be doubled when inherited by child plugins. When a child plugin is registered with a prefix that matches a middleware path, the middleware path is prefixed a second time, causing it to never match incoming requests. This results in complete bypass of Express middleware security controls, including authentication, authorization, and rate limiting, for all routes defined within affected child plugin scopes. No special configuration or request crafting is required. Upgrade to @fastify/express v4.0.5 or later.
Problem types
CWE-436: Interpretation Conflict
Product status
Any version before 4.0.5
4.0.5 (semver)
Credits
FredKSchott
mcollina
UlisesGascon
climba03003
References
github.com/...xpress/security/advisories/GHSA-hrwm-hgmj-7p9c
github.com/...xpress/security/advisories/GHSA-hrwm-hgmj-7p9c
cna.openjsf.org/security-advisories.html