CVE-2026-6556: @fastify/express vulnerable to middleware bypass via non-string mount paths in prefixed plugins
@fastify/express versions 4.0.6 and earlier only rewrite the plugin prefix for middleware mount paths when the path argument is a string. Non-string mount paths (arrays of paths and regular expressions) are left unprefixed inside prefixed plugin scopes, so middleware registered with those forms does not match the actual prefixed request path. Applications that use path-scoped middleware for authentication, authorization, rate limiting, or auditing on routes inside a prefixed scope can be bypassed by sending a request to the prefixed route, because Fastify still matches the route but the middleware is skipped. Patches: upgrade to @fastify/express 4.0.7. Workarounds: use string mount paths instead of arrays or regular expressions in prefixed plugins, or register one use call per path.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
@fastify/expressto a version that resolves this vulnerability.Fixed in 4.0.7 - Configuration
In prefixed plugin scopes, avoid non-string mount paths (arrays of paths and regular expressions). Use string mount paths so the plugin prefix rewrite is applied and middleware cannot be bypassed.
@fastify/express prefixed plugins middleware mount path type = string (avoid arrays/regular expressions)
Event History
Frequently Asked Questions
What is the severity of CVE-2026-6556?
CVE-2026-6556 has a critical severity score of 9.1.
How do I fix CVE-2026-6556?
To fix CVE-2026-6556, upgrade to @fastify/express version 4.0.7 or later.
What vulnerabilities are associated with CVE-2026-6556?
CVE-2026-6556 is associated with middleware bypass vulnerabilities due to non-string mount paths in prefixed plugins.
Which versions of @fastify/express are affected by CVE-2026-6556?
@fastify/express versions 4.0.6 and earlier are affected by CVE-2026-6556.
What impact does CVE-2026-6556 have on application security?
CVE-2026-6556 allows for potential unauthorized access or manipulation of middleware due to improper path handling.