Impact@fastify/express v4.0.4 and earlier fails to normalize URLs before passing them to Express middleware when Fastify router normalization options are enabled. This allows complete bypass of path-scoped authentication middleware via duplicate slashes when ignoreDuplicateSlashes is enabled, or via semicolon delimiters when useSemicolonDelimiter is enabled. In both cases, Fastify router normalizes the URL and matches the route, but @fastify/express passes the original un-normalized URL to Express middleware, which fails to match and is skipped. An unauthenticated attacker can access protected routes by manipulating the URL path. PatchesUpgrade to @fastify/express v4.0.5 or later.
When Fastify router normalization options are enabled (ignoreDuplicateSlashes or useSemicolonDelimiter), the Fastify router normalizes the incoming URL and correctly matches the route. However, @fastify/express passes the original, unmodified URL to Express middleware, which does not match protected path patterns — effectively bypassing authentication middleware. An attacker can, for example, add double slashes (e.g., //admin) or use a semicolon as a separator in the URL to bypass identity verification and directly access a protected resource.
An unauthenticated attacker can gain unauthorized access to protected application routes, potentially reading or modifying data that requires authentication.
Update @fastify/express to version 4.0.5 or later, which fixes URL normalization before passing the request to Express middleware.
@fastify/express version 4.0.4 and earlier, when the ignoreDuplicateSlashes or useSemicolonDelimiter option is enabled in the Fastify router configuration
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XFastify Fastify\/express
APPFastify< 4.0.5
Related vulnerabilities
Pominięcie middleware w @fastify/express — obejście uwierzytelniania
Pominięcie middleware security w @fastify/express — bypass uwierzytelniania
Pominięcie rewrite prefiksu URL w @fastify/http-proxy – dostęp do ukrytych zasobów
Fastify/Middie: pominięcie middleware przez zakodowany slash w URL
Pominięcie uwierzytelnienia w @fastify/middie — brak dziedziczenia middleware