CVE-2026-7120: @fastify/static @fastify/static Vulnerable To Authorization Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-8pvw-jcv7-9cmj
CVSS 5.3
CWE-180
Published
Advisory Summary

CVE-2026-7120 is a MODERATE (CVSS 5.3) @fastify/static vulnerable to authorization bypass vulnerability (CWE-180: Incorrect Behavior Order: Validate Before Canonicalize) affecting @fastify/static libraries in the npm ecosystem. The issue involves @fastify/static vulnerable to authorization bypass via non-canonical url paths. Remediation is available by upgrading affected packages to version 10.1.2.

CVE-2026-7120 at a Glance

CVE Identifier CVE-2026-7120
GHSA Identifier GHSA-8pvw-jcv7-9cmj
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-180: Incorrect Behavior Order: Validate Before Canonicalize
Affected Product @fastify/static
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-7120

To remediate this vulnerability, upgrade all affected @fastify/static dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@fastify/static fixed: 10.1.2
npm install @fastify/static@10.1.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @fastify/static

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-7120, inspect your project dependencies using npm:

npm ls @fastify/static

Analyze the terminal output to locate any version of @fastify/static in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.1.2), your application is affected.

Note: The npm ls @fastify/static command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-180: Incorrect Behavior Order: Validate Before Canonicalize, where the product validates input before it is canonicalized, which prevents the product from detecting data that becomes invalid after the canonicalization step. In @fastify/static, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact `@fastify/static` evaluates the `allowedPath` callback before normalizing dot segments and duplicate slashes in the pathname used for file resolution. Non-canonical pathnames such as `//file`, `/./file`, or `/public/../private/file` bypass `allowedPath` filtering while resolving to the intended file on disk. Applications that use `allowedPath` as a security boundary to restrict access to specific static files or path subtrees may unintentionally expose files that were intended to be denied. ### Patches Upgrade to `@fastify/static` >= 10.1.2. ### Workarounds None. Upgrade to the patched version.

CVE-2026-7120 Affected @fastify/static Versions

1 component(s)
Fixed Versions:
10.1.2
Product / Package Ecosystem Affected Versions Fixed Version
@fastify/static
npm
< 10.1.2
10.1.2

References

Frequently Asked Questions

What is CVE-2026-7120?
CVE-2026-7120 is a security vulnerability in @fastify/static involving @fastify/static vulnerable to Authorization Bypass via Non-Canonical URL Paths under CWE-180: Incorrect Behavior Order: Validate Before Canonicalize.
Which @fastify/static versions are affected?
Affected versions include releases prior to 10.1.2 across affected packages: @fastify/static.
What version fixes CVE-2026-7120?
Upgrading to 10.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @fastify/static affected?
Yes, @fastify/static is affected in releases prior to 10.1.2. Upgrade your dependency to 10.1.2 or later.
What is the CVSS score of CVE-2026-7120?
CVE-2026-7120 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-7120?
CVE-2026-7120 is classified under CWE-180: Incorrect Behavior Order: Validate Before Canonicalize (The product validates input before it is canonicalized, which prevents the product from detecting data that becomes invalid after the canonicalization step.).
How can I check npm dependencies for CVE-2026-7120?
Run the dependency tree command: 'npm ls @fastify/static'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8pvw-jcv7-9cmj",
  "modified" : "2026-07-24T16:43:44Z",
  "published" : "2026-07-24T16:43:44Z",
  "aliases" : [ "CVE-2026-7120" ],
  "summary" : "@fastify/static vulnerable to Authorization Bypass via Non-Canonical URL Paths",
  "details" : "### Impact\n\n`@fastify/static` evaluates the `allowedPath` callback before normalizing dot segments and duplicate slashes in the pathname used for file resolution. Non-canonical pathnames such as `//file`, `/./file`, or `/public/../private/file` bypass `allowedPath` filtering while resolving to the intended file on disk.\n\nApplications that use `allowedPath` as a security boundary to restrict access to specific static files or path subtrees may unintentionally expose files that were intended to be denied.\n\n### Patches\n\nUpgrade to `@fastify/static` >= 10.1.2.\n\n### Workarounds\n\nNone. Upgrade to the patched version.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@fastify/static"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "10.1.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.1.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-static/security/advisories/GHSA-8pvw-jcv7-9cmj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-7120"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-static/commit/878c72e920fabacf7e37739bf78057044717bf63"
  }, {
    "type" : "WEB",
    "url" : "https://cna.openjsf.org/security-advisories.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fastify/fastify-static"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-static/releases/tag/v10.1.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-180" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T16:43:44Z",
    "nvd_published_at" : "2026-07-23T04:16:33Z"
  }
}