Vulnerabilities in pkg:npm/@graphql-mesh/cli

PACKAGE
Advisory Identifier: GHSA-j2wh-wrv3-4x4g
Advisory Summary

CVE-2025-27098 is a MODERATE (CVSS 5.8) unwanted access to the entire vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @graphql mesh/cli libraries in the npm ecosystem. The issue involves unwanted access to the entire file system vulnerability due to a missing check in `staticfiles` http handler. Remediation is available by upgrading affected packages to version 0.82.22, 0.3.19.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@graphql-mesh/cli

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@graphql-mesh/cli. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-j2wh-wrv3-4x4g CVE-2025-27098 MODERATE Unwanted access to the entire file system vulnerability due to a missing check in `staticFiles` HTTP handler

CVE-2025-27098 at a Glance

CVE Identifier CVE-2025-27098
GHSA Identifier GHSA-j2wh-wrv3-4x4g
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product @graphql mesh/cli
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.8

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

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

How to Fix CVE-2025-27098

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

@graphql-mesh/cli fixed: 0.82.22
npm install @graphql-mesh/cli@0.82.22
@graphql-mesh/http fixed: 0.3.19
npm install @graphql-mesh/http@0.3.19
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 @graphql-mesh/cli

How to Check if You Are Affected

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

npm ls @graphql-mesh/cli

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

Note: The npm ls @graphql-mesh/cli 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In @graphql mesh/cli, 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

### Summary Missing check vulnerability in the static file handler allows any client to access the files in the server's file system ### Details When `staticFiles` is set in the `serve` settings in the configuration file, the following handler doesn't check if `absolutePath` is still under the directory provided as `staticFiles`; ```ts if (staticFiles) { router.get('/:relativePath+', async request => { let { relativePath } = request.params; if (!relativePath) { relativePath = 'index.html'; } const absolutePath = path.join(baseDir, staticFiles, relativePath); if (absolutePath.includes(staticFiles) && (await pathExists(absolutePath))) { const readStream = fs.createReadStream(absolutePath); return new Response(readStream as any, { status: 200, }); } return undefined; }); ``` ### Example scenario To reproduce it, set `staticFiles` to the relative path of a directory in `.meshrc.yml`; ```yml serve: staticFiles: ./public ``` Then start the server with `mesh dev`, and browse to `/..%2fpackage.json` then you will see the content of `package.json`. You can even go deeper to see sensitive data; `/..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc/passwd` ### Impact and solution If `staticFiles` is set under `serve` in the configuration file. you have two options to fix vulnerability; - Update `@graphql-mesh/cli` to a version higher than `0.82.21`, and if you use `@graphql-mesh/http`, update it to a version higher than `0.3.18` - Remove `staticFiles` option from the configuration, and use other solutions to serve static files. ### Credits Thanks [alanwillms@gmail.com](mailto:alanwillms@gmail.com) for reporting this vulnerability with details

CVE-2025-27098 Affected @graphql mesh/cli Versions

2 component(s)
Fixed Versions:
0.82.220.3.19
Product / Package Ecosystem Affected Versions Fixed Version
@graphql-mesh/cli
npm
≥ 0.78.0
< 0.82.22
0.82.22
@graphql-mesh/http
npm
< 0.3.19
0.3.19

References

Frequently Asked Questions

What is CVE-2025-27098?
CVE-2025-27098 is a security vulnerability in @graphql mesh/cli involving Unwanted access to the entire file system vulnerability due to a missing check in `staticFiles` HTTP handler under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which @graphql mesh/cli versions are affected?
Affected versions include releases prior to 0.82.22, 0.3.19 across affected packages: @graphql-mesh/cli, @graphql-mesh/http.
What version fixes CVE-2025-27098?
Upgrading to 0.82.22, 0.3.19 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @graphql-mesh/cli affected?
Yes, @graphql-mesh/cli is affected in releases prior to 0.82.22. Upgrade your dependency to 0.82.22 or later.
Is @graphql-mesh/http affected?
Yes, @graphql-mesh/http is affected in releases prior to 0.3.19. Upgrade your dependency to 0.3.19 or later.
What is the CVSS score of CVE-2025-27098?
CVE-2025-27098 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2025-27098?
CVE-2025-27098 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2025-27098?
Run the dependency tree command: 'npm ls @graphql-mesh/cli'. 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-j2wh-wrv3-4x4g",
  "modified" : "2025-02-20T22:51:27Z",
  "published" : "2023-02-16T18:41:07Z",
  "aliases" : [ "CVE-2025-27098" ],
  "summary" : "Unwanted access to the entire file system vulnerability due to a missing check in `staticFiles` HTTP handler",
  "details" : "### Summary\nMissing check vulnerability in the static file handler allows any client to access the files in the server's file system\n\n### Details\nWhen `staticFiles` is set in the `serve` settings in the configuration file, the following handler doesn't check if `absolutePath` is still under the directory provided as `staticFiles`;\n\n```ts\n  if (staticFiles) {\n    router.get('/:relativePath+', async request => {\n      let { relativePath } = request.params;\n      if (!relativePath) {\n        relativePath = 'index.html';\n      }\n      const absolutePath = path.join(baseDir, staticFiles, relativePath);\n      if (absolutePath.includes(staticFiles) && (await pathExists(absolutePath))) {\n        const readStream = fs.createReadStream(absolutePath);\n        return new Response(readStream as any, {\n          status: 200,\n        });\n      }\n      return undefined;\n    });\n ```\n\n### Example scenario\nTo reproduce it, set `staticFiles` to the relative path of a directory in `.meshrc.yml`;\n\n```yml\nserve:\n   staticFiles: ./public\n```\n\nThen start the server with `mesh dev`, and browse to `/..%2fpackage.json` then you will see the content of `package.json`. You can even go deeper to see sensitive data; `/..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc/passwd`\n\n### Impact and solution\nIf `staticFiles` is set under `serve` in the configuration file. you have two options to fix vulnerability;\n\n- Update `@graphql-mesh/cli` to a version higher than `0.82.21`, and if you use `@graphql-mesh/http`, update it to a version higher than `0.3.18`\n- Remove `staticFiles` option from the configuration, and use other solutions to serve static files.\n\n### Credits\nThanks [alanwillms@gmail.com](mailto:alanwillms@gmail.com) for reporting this vulnerability with details",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@graphql-mesh/cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.78.0"
      }, {
        "fixed" : "0.82.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@graphql-mesh/http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.19"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Urigo/graphql-mesh/security/advisories/GHSA-j2wh-wrv3-4x4g"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ardatan/graphql-mesh/security/advisories/GHSA-j2wh-wrv3-4x4g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27098"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Urigo/graphql-mesh/commit/95d93e7c140c2995b37e9d822aa3fe4e24ed2e78"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Urigo/graphql-mesh"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-16T18:41:07Z",
    "nvd_published_at" : "2025-02-20T21:15:26Z"
  }
}