Skip to content

GHSA-x428-ghpx-8j92 CVE-2026-6414

@fastify/static vulnerable to route guard bypass via encoded path separators

Medium npm
Severity
5.9 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.42%
Chance of exploitation in the next 30 days. Higher than 36.53% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-177 Improper Handling of URL Encoding (Hex Encoding)
Fix
9.1.1
Upgrade @fastify/static to this version or later

Description

Impact

@fastify/static v9.1.0 and earlier decodes percent-encoded path separators (%2F) before filesystem resolution, but Fastify's router treats them as literal characters. This creates a routing mismatch: route guards on /admin/* do not match /admin%2Fsecret.html, but @fastify/static decodes it to /admin/secret.html and serves the file.

Applications that rely on route-based middleware or guards to protect files served by @fastify/static can be bypassed with encoded path separators.

Patches

Upgrade to @fastify/static >= 9.1.1.

Workarounds

None. Upgrade to the patched version.

Affected versions

npm

PackageVulnerableFixed in
@fastify/static
>= 8.0.0, < 9.1.1
9.1.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

@fastify/static npm → 9.1.1

npm
npm install @fastify/static@9.1.1
yarn
yarn add @fastify/static@9.1.1
pnpm
pnpm add @fastify/static@9.1.1

Severity breakdown

CVSS 3.1 5.9

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Weakness

CWE-177: Improper Handling of URL Encoding (Hex Encoding)

The product does not properly handle when all or part of an input has been URL encoded.

How to prevent it
  • Architecture and Design: Avoid making decisions based on names of resources (e.g. files) if those resources can have alternate names.
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • Implementation: Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
CVE-2026-76504
A vulnerability in the API session-based authentication management of Cisco Catalyst SD-WAN Manager could allow an unauthenticated, remote attacker to access…
Critical Known exploited Same weakness, CWE-177
GHSA-jqff-g426-hqxp
fast-uri vulnerable to host confusion via percent-encoded scheme normalization
High Same weakness, CWE-177
GHSA-q5qw-h33p-qvwr
Hono vulnerable to arbitrary file access via serveStatic vulnerability
Critical Same weakness, CWE-177
GHSA-fvhj-4qfh-q2hm
Traefik incorrectly processes fragment in the URL, leads to Authorization Bypass
Medium Same weakness, CWE-177
GHSA-g8q8-fggx-9r3q
Keycloak vulnerable to path traversal via double URL encoding
Critical Same weakness, CWE-177
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor