MEDIUM 6.5

CVE-2026-59149: Mockoon Path Traversal Leads to Unauthorized File Disclosure

Mockoon is a tool used by developers to create and test mock APIs locally. A flaw in versions before 9.7.0 allows an attacker to read files from outside the intended mock API directory by crafting specially-formatted file requests. Because the validation check for file paths doesn't properly enforce directory boundaries, an attacker can use path-traversal tricks to escape the sandbox and access other files on the server. This vulnerability requires user interaction (the victim must visit a malicious link or request) but no authentication, and it exposes sensitive data rather than modifying or deleting it.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.5 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Weaknesses (CWE)
CWE-22, CWE-23
Affected products
0 configuration(s)
Published / Modified
2026-07-09 / 2026-07-10

NVD description (verbatim)

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.

6 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in the getSafeFilePath function within Mockoon's server-side file-handling logic. The function validates file paths using a simple prefix test: resolvedPath.startsWith(staticBaseDir). This check lacks a path-separator boundary condition, enabling an attacker to craft relative paths (using ../ sequences) that, when resolved to their absolute form, pass the prefix check by coincidence while actually pointing outside the intended directory. An attacker can exploit this through HTTP sendFile operations, WebSocket messages, or callback mechanisms. The root cause is a classic path-traversal weakness (CWE-22) compounded by improper restriction of path navigation (CWE-23). The fix enforces proper boundary validation in version 9.7.0.

Business impact

For teams using Mockoon in development and testing environments, this vulnerability could lead to unauthorized disclosure of configuration files, credentials, source code, or other sensitive data stored on the same machine. If Mockoon instances are exposed to untrusted networks or used in shared development environments, an attacker can exfiltrate information without authentication. The impact is confined to confidentiality; data integrity and availability are not affected. However, exposed credentials or secrets could facilitate secondary attacks on downstream systems.

Affected systems

Mockoon versions prior to 9.7.0 are affected. The vulnerability impacts the mock API server runtime regardless of the host operating system. It affects all FILE response types that embed request data into the filePath parameter, and can be triggered via HTTP, WebSocket, or callback protocols supported by Mockoon.

Exploitability

The vulnerability is relatively straightforward to exploit from a technical perspective—an attacker needs only to craft a request with a malicious path parameter. However, exploitation does require user interaction: a victim must visit a link or send a request that invokes the mock server. The CVSS vector reflects this (UI:R). No authentication is needed. An attacker must have network access to the Mockoon instance, which in typical development scenarios means local network or internet access depending on where the mock server is running. Proof-of-concept tools are not publicly known to be circulating.

Remediation

Upgrade to Mockoon version 9.7.0 or later. The patched version includes corrected path validation logic that enforces proper directory boundaries. Before upgrading, apply network-level controls to restrict access to Mockoon instances to trusted developers only; avoid exposing mock servers directly to the internet.

Patch guidance

Update Mockoon to version 9.7.0 or any later release. Consult the official Mockoon release notes and advisory for specific installation instructions. If you manage Mockoon via package managers (npm, Docker, etc.), standard update procedures should apply. Verify your update by checking the version reported by the Mockoon UI or CLI. Test your mock API endpoints after patching to ensure configurations remain intact.

Detection guidance

Monitor web server and application logs for unusual file-access patterns, particularly requests containing path-traversal sequences (../, ..\ variations) in parameters that map to file paths. In Mockoon, examine incoming FILE response requests for suspicious filePath values. If Mockoon is exposed to external networks, implement intrusion detection signatures for path-traversal attempts. Check access logs for requests attempting to access files outside the designated mock API directory. Correlate timestamps with any unauthorized file access incidents on the host system.

Why prioritize this

This vulnerability merits prompt patching despite its CVSS score of 6.5 (MEDIUM) because it enables unauthenticated information disclosure in development and testing environments where secrets and source code often reside. The fix is straightforward and low-risk. Organizations should prioritize patching if Mockoon instances handle sensitive test data or run in multi-tenant environments. However, it is not an emergency if Mockoon is confined to isolated development networks with trusted users.

Risk score, explained

The CVSS 3.1 score of 6.5 reflects a network-accessible vulnerability with no authentication requirements, but high impact on confidentiality. The score is tempered by the requirement for user interaction (UI:R), which limits attack scalability. The scope is unchanged (a single Mockoon instance), and there is no impact on integrity or availability. Organizations with strict data-access controls in development environments or those running Mockoon only on isolated networks should assess their own risk as potentially lower.

Frequently asked questions

Does this vulnerability affect production API servers or only development mock servers?

Only Mockoon mock API servers are affected. If you are using Mockoon exclusively for local development and testing, the risk is limited to your development environment. Production API servers using other frameworks or configurations are not affected.

Can an attacker modify or delete files using this vulnerability?

No. The vulnerability allows only file *reading*. An attacker cannot write, modify, or delete files. The threat is limited to confidentiality breaches—exposure of sensitive data such as credentials, configuration, or source code.

Do I need to update immediately if my Mockoon instance is only accessible on my local network?

While not an emergency, an update is still recommended. If your local network includes multiple developers or contractors, or if network boundaries are unclear, treat it as a higher priority. If the instance is truly isolated to a single development machine and not exposed to shared networks, the practical risk is lower, but upgrading to 9.7.0 is still the best practice.

What should I do if I suspect this vulnerability was exploited?

Check access logs for suspicious file-path requests or unauthorized data access. Review the contents of sensitive files (credentials, configuration, source code) for any signs of exfiltration or misuse. If credentials were exposed, rotate them. Assess the blast radius by determining what data was stored in the Mockoon server's accessible file system.

This analysis is provided for informational purposes to help security teams understand and prioritize vulnerability management. It is not a guarantee of security and should not replace independent security assessments, vendor advisories, or internal risk policies. Always verify patch applicability and compatibility within your environment before deployment. The information is accurate to the published CVE record as of the analysis date; refer to official vendor sources for the latest guidance. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).