CVE-2026-18427
Received Received - Intake

Path Traversal in Fastify Static

Vulnerability report for CVE-2026-18427, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-06

Last updated on: 2026-08-06

Assigner: openjs

Description

@fastify/static before version 10.1.3 contains an incomplete fix for a previous route guard bypass. The static file handler rejected only parent directory segments, but it did not canonicalize dot segments, duplicate slashes, encoded dots, or backslashes before route matching and before delegating to the send layer. As a result, an unauthenticated attacker could request a file protected by a route based guard using a non canonical path form that misses the guarded route yet resolves back onto the protected file, disclosing its contents. Applications that protect a subtree of the static root with a route based guard are affected, while applications relying on the allowedPath option are not. This is fixed in @fastify/static 10.1.3, which canonicalizes the pathname, including rejecting backslashes, on the path used for routing and serving.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-06
Last Modified
2026-08-06
Generated
2026-08-06
AI Q&A
2026-08-06
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
fastify static to 10.1.3 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
CWE-436 Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-18427 is a path traversal vulnerability in the @fastify/static npm package versions before 10.1.3. It allows attackers to bypass route-based protections by using non-canonical path formats like double slashes, dot segments, or encoded dots. This causes the plugin to serve protected files that should be restricted by middleware or guards.

Detection Guidance

To detect this vulnerability, check the version of @fastify/static in your project using 'npm list @fastify/static' or 'npm ls @fastify/static'. If the version is below 10.1.3, the system is vulnerable. Test for path traversal attempts by sending requests with non-canonical paths like '/./deep/secret.txt', '//deep/secret.txt', or '/%2e/deep/secret.txt' to see if protected files are accessible.

Monitor server logs for unusual path patterns or access to protected files. Use tools like curl to test paths: 'curl http://localhost:3000/./protected/file.txt' or 'curl http://localhost:3000//protected/file.txt'.

Impact Analysis

An unauthenticated attacker could access sensitive files protected by route guards by crafting requests with non-standard path formats. This could lead to unauthorized disclosure of confidential data, such as configuration files, source code, or other restricted resources.

Compliance Impact

This vulnerability could lead to unauthorized access to sensitive data, violating compliance requirements for data protection such as GDPR (unauthorized data access) and HIPAA (exposure of protected health information). Organizations must address this to maintain regulatory compliance.

Mitigation Strategies

Immediately upgrade @fastify/static to version 10.1.3 or later using 'npm update @fastify/static' or by updating the package.json file. If upgrading is not possible, remove route-based middleware or guards protecting files served by @fastify/static as a temporary workaround.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-18427. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart