Double Decoding of the Same Data Affecting @fastify/express package, versions <4.0.10


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.6% (50th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-FASTIFYEXPRESS-22743475
  • published23 Nov 2026
  • disclosed21 Nov 2026
  • creditMatteo Collina

Introduced: 21 Nov 2026

NewCVE-2026-133120  (opens in a new tab)
CWE-174  (opens in a new tab)

How to fix?

Upgrade @fastify/express to version 4.0.10 or higher.

Overview

@fastify/express is an Express compatibility layer for Fastify

Affected versions of this package are vulnerable to Double Decoding of the Same Data via the normalizeUrl function, which passes Express a request URL that does not always match the path Fastify's router dispatched, allowing path-scoped Express middleware to be skipped while the route handler still runs. Three request forms trigger the mismatch: a backslash combined with whitespace or # (e.g. a percent-encoded backslash) causes Express to rewrite \ to / and miss parameterized, prefixed, and RegExp mounts; %25 is decoded twice so middleware and handler see different parameter and query values; and a request target beginning with * is routed to a path by Fastify that Express does not match against the corresponding mount. An unauthenticated client can therefore reach a handler that authentication, authorization, or rate-limiting middleware was meant to protect.

Workaround

Enforce authentication in a Fastify hook (such as preHandler) that runs after the router has resolved the request, basing the decision on the matched route (request.routeOptions.url). To block only the two specific bypasses, reject request targets that start with * or whose path contains a backslash in an onRequest hook registered before @fastify/express.

CVSS Base Scores

version 4.0
version 3.1