Summary
Unwanted access to the entire file system vulnerability due to a missing check in staticFiles HTTP handler
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;
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;
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/clito a version higher than0.82.21, and if you use@graphql-mesh/http, update it to a version higher than0.3.18 - Remove
staticFilesoption from the configuration, and use other solutions to serve static files.
Credits
Thanks [email protected] for reporting this vulnerability with details
Impact
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
CVE-2025-27098 has a CVSS score of 5.8 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.82.22, 0.3.19); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
@graphql-mesh/cli to 0.82.22 or later; @graphql-mesh/http to 0.3.19 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2025-27098? CVE-2025-27098 is a medium-severity path traversal vulnerability in @graphql-mesh/cli (npm), affecting versions >= 0.78.0, < 0.82.22. It is fixed in 0.82.22, 0.3.19. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- How severe is CVE-2025-27098? CVE-2025-27098 has a CVSS score of 5.8 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2025-27098?
@graphql-mesh/cli(npm) (versions >= 0.78.0, < 0.82.22)@graphql-mesh/http(npm) (versions < 0.3.19)
- Is there a fix for CVE-2025-27098? Yes. CVE-2025-27098 is fixed in 0.82.22, 0.3.19. Upgrade to this version or later.
- Is CVE-2025-27098 exploitable, and should I be worried? Whether CVE-2025-27098 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2025-27098 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2025-27098?
- Upgrade
@graphql-mesh/clito 0.82.22 or later - Upgrade
@graphql-mesh/httpto 0.3.19 or later
- Upgrade