# CVE-2025-27098: Unwanted access to the entire file system vulnerability due to a missing check in `staticFiles` HTTP handler

> Attackers can read arbitrary files from the server filesystem if the staticFiles option is enabled in GraphQL Mesh configuration.

- **Severity:** Medium 5.8 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 20 Feb 2025
- **Updated:** 20 Feb 2025
- **Also known as:** GHSA-j2wh-wrv3-4x4g

## What is CVE-2025-27098?

CVE-2025-27098 is a medium-severity path traversal vulnerability in ardatan graphql-mesh, published on 20 Feb 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

GraphQL Mesh is a GraphQL Federation framework and gateway for both GraphQL Federation and non-GraphQL Federation subgraphs, non-GraphQL services, such as REST and gRPC, and also databases such as MongoDB, MySQL, and PostgreSQL. Missing check vulnerability in the static file handler allows any client to access the files in the server's file system. 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`. Users have two options to fix vulnerability; 1. 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` 2. Remove `staticFiles` option from the configuration, and use other solutions to serve static files.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2025-27098?

4 open source packages ship an affected version, including @graphql-mesh/cli and @graphql-mesh/http. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@graphql-mesh/cli` | npm | From 0.78.0 | 0.82.22 |
| `@graphql-mesh/cli` | npm | From 0.78.0 | 0.82.22 |
| `@graphql-mesh/http` | npm | All versions | 0.3.19 |
| `@graphql-mesh/http` | npm | All versions | 0.3.19 |

Products: The-Guild Graphql Mesh Cli, The-Guild Graphql Mesh Http.

## How do I fix CVE-2025-27098?

Upgrade @graphql-mesh/cli to 0.82.22 or later.

## Is CVE-2025-27098 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-27098 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-27098 and fix it if it is affected.

What it is: CVE-2025-27098 is a medium-severity path traversal vulnerability in ardatan graphql-mesh, published on 20 Feb 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-27098 exists.

Affected packages and fixed versions:
- @graphql-mesh/cli (npm): affected from 0.78.0; fixed in 0.82.22
- @graphql-mesh/cli (npm): affected from 0.78.0; fixed in 0.82.22
- @graphql-mesh/http (npm): affected all versions; fixed in 0.3.19
- @graphql-mesh/http (npm): affected all versions; fixed in 0.3.19

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-27098/ (Markdown: https://insights.sbomify.com/CVE-2025-27098/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-27098
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-27098
- OSV: https://osv.dev/vulnerability/CVE-2025-27098

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-27098/
Summaries are generated and may contain mistakes; the official description above is the record.
