Improper Validation of Specified Type of Input Affecting @fastify/middie package, versions >=8.3.0 <9.3.7


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.5% (45th 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-FASTIFYMIDDIE-23050802
  • published30 Nov 2026
  • disclosed19 Nov 2026
  • creditDaniel Coles, manus-use

Introduced: 19 Nov 2026

NewCVE-2026-132131  (opens in a new tab)
CWE-1287  (opens in a new tab)

How to fix?

Upgrade @fastify/middie to version 9.3.7 or higher.

Overview

@fastify/middie is a Middleware engine for Fastify

Affected versions of this package are vulnerable to Improper Validation of Specified Type of Input via the use method's array mount-path handling, where the internal sanitizePrefixUrl helper only processes string inputs but use() also accepts an array of mount paths and passes it through unchanged. When an array is supplied, the string normalization silently does nothing, so a trailing slash on an array element survives into the generated route-matching regular expression, and an element of exactly / is dropped entirely. The compiled regex then fails to match subroutes of the affected mount paths, causing path-scoped middleware such as authentication, authorization, or rate limiting to be skipped while Fastify's router still dispatches the request to the handler, allowing an unauthenticated client to reach protected routes.

Note: This is only exploitable when middleware is mounted on an array of paths where at least one element ends with a trailing slash (including one introduced by a plugin prefix ending in /) or is exactly /.

CVSS Base Scores

version 4.0
version 3.1