# CVE-2026-7120: Fastify @fastify/static authorization bypass via non-canonical paths

Source: https://junglewise.ai/threats/cve-2026-7120-fastify-fastify-static-authorization-bypass-via-non-canonical  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-23. Updated: 2026-07-24  
License: CC BY 4.0 with a link back

CVE-2026-7120 · Severity: medium · CVSS 5.3 · Published 2026-07-23

A vulnerability in the @fastify/static library, which is used to serve files like images and scripts for web applications, could allow unauthorized access to restricted files. By using specially crafted web addresses with extra slashes or dots, an attacker can bypass security rules intended to keep certain files private. This could lead to the exposure of sensitive internal files or data that should not be publicly accessible.

Technologies: [Fastify Static](https://junglewise.ai/threats/technologies/static), [@fastify/static (npm)](https://junglewise.ai/threats/technologies/fastify-static). Vendors: [Fastify](https://junglewise.ai/threats/vendors/fastify), [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-7120 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-7120 being exploited in the wild.

**How severe is CVE-2026-7120?** Medium severity, with a CVSS score of 5.3, published 23 July 2026.

**Which products and versions are affected?** Fastify Static <= 10.1.1; @fastify/static (npm) <= 10.1.1, SEMVER:introduced=0,fixed=10.1.2.

**Is there a fix for CVE-2026-7120?** Yes. @fastify/static (npm): upgrade to 10.1.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-7120 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-7120?** Check whether you run Fastify Static or @fastify/static (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @fastify/static (npm): upgrade to 10.1.2 or later

  ```sh
  npm install @fastify/static@10.1.2
  ```


## Technical details

The @fastify/static plugin fails to canonicalize URL paths before executing the 'allowedPath' validation callback. This root cause allows attackers to use non-canonical pathnames (e.g., '//file', '/./file', or directory traversal sequences like '/public/../private/file') to bypass security filters that rely on the 'allowedPath' check. Because the validation occurs before dot segments and duplicate slashes are normalized, the filter may permit a path that later resolves to a restricted file on the disk. This is a remote, unauthenticated attack vector. The issue is fixed in version 10.1.2.

## Affected products

- Fastify @fastify/static <= 10.1.1

## Identifiers

- CVE-2026-7120
- GHSA-8pvw-jcv7-9cmj

## Timeline

- 2026-07-22: disclosed
- 2026-07-23: advisory: NVD publication
- 2026-07-24: patched: GitHub Advisory published and reviewed

## References

- [https://api.github.com/users/yuki-matsuhashi](https://api.github.com/users/yuki-matsuhashi)
- [https://github.com/yuki-matsuhashi](https://github.com/yuki-matsuhashi)
- [https://api.github.com/users/yuki-matsuhashi/gists%7B/gist_id%7D](https://api.github.com/users/yuki-matsuhashi/gists%7B/gist_id%7D)
- [https://api.github.com/users/yuki-matsuhashi/repos](https://api.github.com/users/yuki-matsuhashi/repos)
- [https://avatars.githubusercontent.com/u/250794953?v=4](https://avatars.githubusercontent.com/u/250794953?v=4)
- [https://api.github.com/users/yuki-matsuhashi/events%7B/privacy%7D](https://api.github.com/users/yuki-matsuhashi/events%7B/privacy%7D)

## Related threats

- [Fastify @fastify/static route guard bypass via path traversal](https://junglewise.ai/threats/cve-2026-15074-fastify-fastify-static-route-guard-bypass-via-path-traversal)
- [Fastify @fastify/static path traversal in directory listing](https://junglewise.ai/threats/cve-2026-6410-fastify-fastify-static-path-traversal-in-directory-listing)
- [Fastify @fastify/static route guard bypass via encoded path separators](https://junglewise.ai/threats/cve-2026-6414-fastify-fastify-static-route-guard-bypass-via-encoded-path)
- [fastify-static open redirect and DOS with user input](https://junglewise.ai/threats/cve-2021-22964-fastify-static-open-redirect-and-dos-with-user-input)
- [Fastify fastify-static open redirect](https://junglewise.ai/threats/cve-2021-22963-fastify-fastify-static-open-redirect)
