# GHSA-P497-QC9Q-9HGX: @fastify/static vulnerable to route guard bypass via default index and extension resolution

- Database: GitHub
- Severity: CVSS 5.3 (Medium)
- Published: 2026-11-19
- Modified: 2026-11-19

## Tracked as

- [CVE-2026-115515](https://cve.now/CVE-2026-115515.md): @fastify/static remote code execution in static route guard

## Affected versions

- @fastify/static (npm): fixed in 10.1.8

## Description

### Impact

`@fastify/static` is vulnerable to a bypass of the `allowedPath` guard via default index and extension resolution. The `allowedPath` callback receives only the requested pathname, but `@fastify/send` selects the file to serve afterwards: a request for a directory such as `/private/` resolves to its default `index.html`, and an extensionless request such as `/secret` resolves through the configured `extensions` to `secret.html`. The selected file is then streamed without re-checking it against `allowedPath`, so a guard that denies `/private/index.html` or `/secret.html` is bypassed by requesting the directory or extensionless form.

Applications that rely on `allowedPath` to keep files inside the static root from being served can have those files read by any unauthenticated client when the denied file is reachable as a directory index or an extension match.

### Patches

Upgrade to `@fastify/static` >= 10.1.8.

### Workarounds

Until upgrading, deny the directory and extensionless forms in `allowedPath` as well, for example deny `/private/` and `/secret` in addition to `/private/index.html` and `/secret.html`, or disable the `index` and `extensions` options.

### References

- [GHSA-r799-r9gc-m956](https://github.com/fastify/fastify-static/security/advisories/GHSA-r799-r9gc-m956) (CVE-2026-90982), the same `allowedPath` guard, case-spelling bypass vector

## References

- https://github.com/fastify/fastify-static/security/advisories/GHSA-p497-qc9q-9hgx

Page: https://cve.now/GHSA-P497-QC9Q-9HGX
