CVE-2026-18427: @fastify/static vulnerable to route guard bypass via non-canonical path segments
@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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
@fastify/staticto a version that resolves this vulnerability.Fixed in 10.1.3
Event History
Frequently Asked Questions
What is the severity of CVE-2026-18427?
CVE-2026-18427 has a severity rating of high, with a score of 7.5.
What type of vulnerability is CVE-2026-18427?
CVE-2026-18427 is classified as a Path Traversal vulnerability.
How do I fix CVE-2026-18427?
To fix CVE-2026-18427, upgrade @fastify/static to version 10.1.3 or later.
What does CVE-2026-18427 affect?
CVE-2026-18427 affects the @fastify/static package prior to version 10.1.3.
What can happen if CVE-2026-18427 is exploited?
Exploitation of CVE-2026-18427 can lead to a route guard bypass, allowing unauthorized access to static files.