{"id":"CVE-2025-27098","aliases":["CVE-2025-27098","GHSA-j2wh-wrv3-4x4g"],"related":[],"kind":"vulnerability","state":"published","title":"Unwanted access to the entire file system vulnerability due to a missing check in `staticFiles` HTTP handler in graphql-mesh","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"GraphQL Mesh es un framework de trabajo y puerta de enlace de GraphQL Federation tanto para GraphQL Federation como para subgrafos que no son de GraphQL Federation, servicios que no son de GraphQL, como REST y gRPC, y también bases de datos como MongoDB, MySQL y PostgreSQL. La vulnerabilidad de falta de verificación en el controlador de archivos estáticos permite que cualquier cliente acceda a los archivos en el sistema de archivos del servidor. Cuando se configura `staticFiles` en la configuración de `serve` en el archivo de configuración, el siguiente controlador no verifica si `absolutePath` todavía está bajo el directorio proporcionado como `staticFiles`. Los usuarios tienen dos opciones para corregir la vulnerabilidad; 1. Actualizar `@graphql-mesh/cli` a una versión superior a `0.82.21`, y si usa `@graphql-mesh/http`, actualizarlo a una versión superior a `0.3.18` 2. Eliminar la opción `staticFiles` de la configuración y usar otras soluciones para servir archivos estáticos.","source":"nvd"}],"published":"2023-02-16T18:41:07.000Z","modified":"2026-06-17T09:03:01.720Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","score":5.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","score":5.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","score":5.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"@graphql-mesh/cli: >= 0.78.0, < 0.82.22","status":"affected"},{"version":"@graphql-mesh/http: < 0.3.19","status":"affected"}],"vendor":"ardatan","product":"graphql-mesh","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.78.0","status":"affected","fixed":"0.82.22"}],"ecosystem":"npm","package":"@graphql-mesh/cli","purl":"pkg:npm/%40graphql-mesh/cli","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.3.19"}],"ecosystem":"npm","package":"@graphql-mesh/http","purl":"pkg:npm/%40graphql-mesh/http","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.78.0","fixed":"0.82.22"}],"vendor":"the-guild","product":"graphql_mesh_cli","cpe":"cpe:2.3:a:the-guild:graphql_mesh_cli:*:*:*:*:*:node.js:*:*","source":"nvd"},{"ranges":[{"status":"affected","fixed":"0.3.19"}],"vendor":"the-guild","product":"graphql_mesh_http","cpe":"cpe:2.3:a:the-guild:graphql_mesh_http:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/ardatan/graphql-mesh/security/advisories/GHSA-j2wh-wrv3-4x4g","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Urigo/graphql-mesh/security/advisories/GHSA-j2wh-wrv3-4x4g","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27098","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Urigo/graphql-mesh/commit/95d93e7c140c2995b37e9d822aa3fe4e24ed2e78","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Urigo/graphql-mesh","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-02-20T21:03:28.726Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-27098","url":"https://www.cve.org/CVERecord?id=CVE-2025-27098","licence":"CVE Terms of Use","modified":"2025-02-20T21:04:05.183Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j2wh-wrv3-4x4g","url":"https://github.com/advisories/GHSA-j2wh-wrv3-4x4g","licence":"CC-BY-4.0","modified":"2025-02-20T23:12:14.649Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-27098","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27098","licence":"Public domain","modified":"2026-06-17T09:03:01.720Z"}],"updatedAt":"2026-11-25T22:58:54.203Z","epss":{"score":0.00369,"percentile":0.32818,"date":"2026-12-01T12:00:22.000Z"}}