Incorrect Behavior Order: Validate Before Canonicalize Affecting @fastify/static package, versions <10.1.2


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.23% (15th 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-FASTIFYSTATIC-18233800
  • published23 Jul 2026
  • disclosed23 Jul 2026
  • credityuki-matsuhashi

Introduced: 23 Jul 2026

NewCVE-2026-7120  (opens in a new tab)
CWE-180  (opens in a new tab)

How to fix?

Upgrade @fastify/static to version 10.1.2 or higher.

Overview

@fastify/static is a Plugin for serving static files as fast as possible.

Affected versions of this package are vulnerable to Incorrect Behavior Order: Validate Before Canonicalize via non-canonical URL path handling in the allowedPath check in index.js. An attacker can bypass file/subtree restrictions by sending paths such as //file, /./file, or /public/../private/file that allowedPath evaluates before pathname normalization. Applications that rely on allowedPath to block specific static files or deny access outside an allowed subtree can serve files that should have been rejected, exposing protected content to unauthorized clients.

CVSS Base Scores

version 4.0
version 3.1