Sep 12, 2026·5 min read·3 visits
A path traversal vulnerability in Mockoon's backend server allows unauthenticated clients to read files from sibling directories outside the configured base directory by exploiting character-by-character prefix validation.
CVE-2026-59149 identifies a directory traversal vulnerability in `@mockoon/commons-server`, the backend mock-server library powering the Mockoon application. The flaw occurs in the path containment validation logic used during raw file response generation. An unauthenticated attacker can exploit this weakness to retrieve arbitrary files from sibling directories sharing a common prefix with the designated static base directory.
CVE-2026-59149 represents a path traversal vulnerability in @mockoon/commons-server, the underlying backend engine for Mockoon. Mockoon is an open-source development tool designed to configure, run, and scale local mock APIs. When Mockoon is configured to serve static assets or process dynamic file-serving endpoints, it executes verification routines to restrict file requests to predefined target directories.\n\nThe verification system fails to properly restrict the target filesystem scope. An unauthenticated network adversary can bypass path verification and gain read access to files outside of the configured root directory. The root cause resides in character-level prefix comparison logic that fails to enforce directory-boundary separation.\n\nThis vulnerability primarily impacts developers and automated environments running Mockoon inside local development hosts or shared integration servers. Compromise of the local filesystem can leak sensitive metadata, application code, environment assets, or configuration keys stored in sibling workspace folders.
The path containment vulnerability resides in the validation check defined within packages/commons-server/src/libs/server/server.ts under the helper method getSafeFilePath. This method checks if the requested path remains confined within the static directory boundaries.\n\nPrior to version 9.7.0, the validation relied on the JavaScript String.prototype.startsWith() function to check if the target destination resolved path had the correct folder prefix. This string prefix check did not append directory separators or perform semantic path segment checks before evaluating containment.\n\nBecause of this lack of boundary checking, paths that share character prefixes can pass validation. For instance, if the configured directory path is /srv/public and the resolved file path is /srv/public_backup/secret.json, the validation step evaluates '/srv/public_backup/secret.json'.startsWith('/srv/public') as true. This allows the system to read and return files from sibling directories that begin with the same string prefix, bypassing intended directory boundaries.
Before the patch in version 9.7.0, getSafeFilePath verified both absolute and relative file paths as follows:\n\ntypescript\nif (isPathAbsolute) {\n if (!staticBaseDir || !resolvedPath.startsWith(staticBaseDir)) {\n throw new Error(\n 'Access to absolute path outside of the original static base directory'\n );\n }\n} else {\n if (!resolvedPath.startsWith(this.options.environmentDirectory)) {\n throw new Error(\n 'Access to relative path outside of the environment base directory'\n );\n }\n}\n\n\nThe official remediation in commit b42bdfb7f82e83f0e81bea8e6fe41adf5ec82585 introduced a secure containment evaluation method isPathInsideBase utilizing Node.js's native path.relative function:\n\ntypescript\nconst isPathInsideBase = (basePath: string, candidatePath: string) => {\n const relativePath = relative(basePath, candidatePath);\n return (\n relativePath === '' ||\n (!relativePath.startsWith('..') && !isAbsolute(relativePath))\n );\n};\n\n\nBy resolving the relative distance from basePath to candidatePath, the function checks if the candidate path steps out of the parent structure. If the calculated relative path contains the upward traversal prefix .., the system correctly flags and blocks the request.
Exploiting this path traversal relies on configuring or targeting a Mockoon endpoint with a response type set to FILE where the path uses a dynamic helper, such as {{queryParam 'file'}} or {{urlParam 'file'}}. The presence of dynamic template components allows remote client control over the file lookup string.\n\nAn attacker identifies an active file retrieval route and submits a query string containing traversal operators targeted at sibling folders, such as ?file=../../app_backup/.env. The application resolves the input relative to the mock application directory.\n\nThe resolved absolute location is evaluated against the validation engine. Because the sibling folder name starts with the prefix of the base folder, the prefix validation returns true, allowing the backend file service to open, read, and return the sensitive data to the network client.\n\nmermaid\ngraph LR\n A["Client Input (Traversal Payload)"] --> B["Path Resolution (Node.js)"]\n B --> C["Validate Path in getSafeFilePath()"]\n C --> D{"path.relative Check"}\n D -- "Begins with '..'" --> E["Throw Access Error"]\n D -- "Contained within Base" --> F["Read & Serve File Content"]\n
The potential impact of CVE-2026-59149 is marked as CVSS 6.5 (Medium). The exploit allows unauthorized, unauthenticated reading of data directly from the host filesystem in environments running the Mockoon server backend.\n\nDepending on the system layout, attackers can read private workspace configuration files, source code, database passwords, or operational credentials located in adjacent directories sharing the prefix name. This vulnerability is especially critical if Mockoon is deployed inside continuous integration (CI) environments or shared testing infrastructure.\n\nBecause this vulnerability does not allow modification of file contents or remote code execution directly, the scope is unchanged, and integrity is not directly compromised. However, the exfiltrated sensitive files often facilitate escalation paths in overall system deployment infrastructure.
Remediation requires upgrading the Mockoon client, the command-line engine, or the underlying @mockoon/commons-server package to version 9.7.0 or higher. Version 9.7.0 successfully implements a robust boundary verification engine that rejects sibling folder containment bypasses.\n\nIf upgrading cannot be executed immediately, administrators must implement compensating controls:\n\n1. Audit active Mockoon mock setups and remove any FILE responses configured with dynamic template variable components.\n\n2. Introduce reverse proxies or security filters to strip directory traversal characters (e.g. ../ and corresponding URL encodings) from request paths.\n\n3. Run Mockoon under containerized or highly restricted execution boundaries with standard non-root service accounts, ensuring the host mount volumes do not expose sibling project configurations.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
mockoon Mockoon | < 9.7.0 | 9.7.0 |
@mockoon/commons-server Mockoon | < 9.7.0 | 9.7.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 |
| Attack Vector | Network |
| CVSS v3.1 Score | 6.5 |
| EPSS Score | 0.00483 (0.48%) |
| Impact | Confidentiality (High) |
| Exploit Status | Proof of Concept / Public Details Available |
| KEV Status | Not Listed |
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
CVE-2026-11746 is a critical vulnerability in Central Dogma Server prior to version 0.84.0, where an embedded ZooKeeper replication secret silently falls back to a publicly known, hard-coded default string ('ch4n63m3'). Remote attackers with access to the replication network can authenticate as legitimate cluster peers, potentially leading to unauthorized data exposure, state manipulation, or complete cluster takeover.
A logical verification flaw in ZITADEL's external JWT Identity Provider validation allows attackers to bypass session expiration checks. If an incoming JWT lacks the 'exp' claim, the system skips validation entirely, creating an indefinitely valid session. This issue has been addressed in versions 3.4.12 and 4.15.2.
An in-depth analysis of CVE-2026-59148, a high-severity flaw in Mockoon where unauthenticated administrative endpoints and a wildcard Cross-Origin Resource Sharing (CORS) policy allow remote execution, state poisoning, and credential theft.
An improper authentication vulnerability (CWE-287) in ZITADEL's external identity provider handler before version 4.15.3 allows remote attackers to perform complete account takeover. When auto-linking by email is enabled, ZITADEL verifies that the local target account has a verified email address but fails to verify if the external provider confirmed ownership of that same email. Attackers can exploit this by registering an unverified account with a victim's email address on a permissive external provider, leading to unauthorized account binding and persistent access.
A critical authentication bypass and cross-tenant account takeover vulnerability exists in the Prowler cloud security platform due to improper validation of the SAML Assertion Consumer Service (ACS) flow. An authenticated attacker controlling a custom Identity Provider (IdP) can forge assertions targeting arbitrary user identities across distinct tenants, allowing complete unauthorized access to target tenant-scoped resources.
An issue was identified in Central Dogma prior to version 0.84.0. The Git mirror SSH client does not verify remote host keys for git+ssh:// connections, which allows an on-path attacker to execute man-in-the-middle attacks and compromise mirrored repositories.