CVE-2026-115515: @fastify/static vulnerable to route guard bypass via default index and extension resolution
@fastify/static is the Fastify plugin for serving static files. In versions before 10.1.8, the allowedPath guard receives only the requested pathname, but the underlying send step selects the file to serve afterwards, so a request for a directory resolves to its default index file and an extensionless request resolves through the configured extensions to a matching file. The selected file is streamed without being re-checked against allowedPath, so a guard that denies a specific file is bypassed by requesting its directory or extensionless form. An unauthenticated client can read files inside the static root that the application meant to keep private whenever the denied file is reachable as a directory index or an extension match. The issue is fixed in @fastify/static 10.1.8, and users should upgrade to 10.1.8 or later. As a workaround, also deny the directory and extensionless forms in allowedPath, or disable the index and extensions options.
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.8 - Configuration
Disable the index and extensions options, or update allowedPath to also deny directory and extensionless forms.
@fastify/static index and extensions = disabled
Event History
Frequently Asked Questions
Which deployments are exposed to this bypass?
Deployments using @fastify/static before 10.1.8 are exposed if they use allowedPath to deny a file under the static root and that file can be reached through default index resolution or configured extension resolution. The issue requires the index or extensions behavior to provide an alternate request form for the denied file.
What does an attacker need to exploit the issue?
An attacker only needs network access to send HTTP requests; no authentication or user interaction is required. They must know or identify a denied file that is reachable by requesting its containing directory or an extensionless path.
How can we mitigate the issue before upgrading?
Update to @fastify/static 10.1.8 or later. If an immediate upgrade is not possible, deny the corresponding directory and extensionless request forms in allowedPath, or disable the index and extensions options.
How can we determine whether our current configuration is affected?
Review allowedPath rules for specific files that are intended to be private within the static root. Test whether requesting the parent directory returns that file as an index, or whether requesting the path without its extension resolves to the denied file through configured extensions.