CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-59148

CVE-2026-59148: Unauthenticated Administrative API and CORS Misconfiguration in Mockoon

Alon Barad
Alon Barad
Software Engineer

Sep 12, 2026·6 min read·21 visits

Executive Summary (TL;DR)

Unauthenticated endpoints and wildcard CORS in Mockoon allow local and remote attackers to compromise administrative APIs and hijack local server instances.

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.

Vulnerability Overview

Mockoon versions prior to 9.7.0 contain a critical vulnerability where high-privilege administrative endpoints, routed through the /mockoon-admin path, are exposed by default without authentication. These routes are co-located on the same listener port as standard mock routes designed to receive untrusted external traffic. This architecture creates an entry point where any party capable of reaching the mock service can access administrative controls.\n\nThe administration endpoints provide several dangerous actions, such as dynamically editing mock route behaviors, viewing raw transaction logs containing HTTP headers, and writing configuration parameters directly to the running process. Because the application did not perform any access control verification, this design flaw left Mockoon services vulnerable to unauthorized administrative operations. This class of weakness is categorized under CWE-306.\n\nIn addition to the lack of authentication, Mockoon implemented a permissive Cross-Origin Resource Sharing (CORS) configuration that used a wildcard origin header. When local servers are executed during development, browsers allow external web resources to query these services if wildcard headers are active. Consequently, malicious websites could execute cross-origin requests targeting Mockoon's administrative API, creating a remote exploitation vector against local systems.

Root Cause Analysis

The primary technical flaw resides within the administrative route registration module in packages/commons-server/src/libs/server/admin-api.ts. In affected versions, the router handles administrative requests without invoking any session, credential, or token-based authorization filters. Because administrative interfaces share the same port and server thread as user-defined routes, any client that can route requests to Mockoon also has access to administrative controls.\n\nFurthermore, the CORS middleware registered for administrative endpoints unconditionally set the Access-Control-Allow-Origin header to *. This configuration tells the web browser to ignore cross-origin isolation policies. If an engineer hosts Mockoon locally and visits a malicious site, scripts on that site can send queries to local admin ports and read the responses directly, bypassing standard local-host isolation boundaries.\n\nAnother critical weakness involves the /mockoon-admin/env-vars route mapping to setEnvVarHandler. The code took parameters from the incoming request body and assigned them directly to Node's process.env dictionary without sanitization or validation. Without structural constraints, attackers could overwrite sensitive variables like NODE_OPTIONS to execute shell commands, enabling arbitrary code execution under the privileges of the active process.

Code Analysis

In versions preceding the fix, the CORS configuration on /mockoon-admin* paths configured permissive headers without authentication check steps. The implementation of environment variable writing accepted keys directly into the global environment array.\n\ntypescript\n// VULNERABLE: Wildcard CORS configuration without authorization checks\napp.use(`${adminApiPrefix}*`, (req, res, next) => {\n res.setHeaders(\n new Headers({\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS',\n 'Access-Control-Allow-Headers': 'Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With'\n })\n );\n next();\n});\n\n// VULNERABLE: Direct write capability to environment dictionary\nconst setEnvVarHandler = (req, res) => {\n try {\n const { key, value } = req.body;\n if (key !== undefined && value !== undefined) {\n process.env[key] = value;\n res.send({ message: `Environment variable '${key}' has been set` });\n }\n } catch (_error) {\n res.status(400).send({ message: 'Invalid request' });\n }\n};\n\n\nThe fix introduced in commit c420b5a56918475b8663977b51e5f986e45b3299 added mandatory authorization token verification using a cryptographically secure token. It also restricted CORS origins to authorized lists and limited environment variable modifications to keys that begin with an approved prefix.\n\ntypescript\n// PATCHED: Authentication check using constant-time evaluation\nconst hasValidAdminApiToken = (providedToken: string): boolean => {\n const expectedTokenBuffer = Buffer.from(adminApiAuthToken, 'utf8');\n const providedTokenBuffer = Buffer.from(providedToken, 'utf8');\n if (expectedTokenBuffer.length !== providedTokenBuffer.length) {\n return false;\n }\n return timingSafeEqual(expectedTokenBuffer, providedTokenBuffer);\n};\n\n// PATCHED: Prefix restriction on environment variable assignments\nif (!envVarsPrefix) {\n res.status(403).send({\n message: 'Environment variable writes are disabled when the prefix is empty'\n });\n return;\n}\nconst prefixedKey = key.startsWith(envVarsPrefix) ? key : envVarsPrefix + key;\nprocess.env[prefixedKey] = value;\n\n\nThis update resolves the core vulnerabilities by securing the administration interface against unauthorized access and preventing dangerous environment modifications. The use of timingSafeEqual blocks attempts to crack the token via timing side-channels, ensuring the validation logic is robust.

Exploitation Methodology

Exploitation of CVE-2026-59148 relies either on direct network access to the port or on a drive-by cross-origin attack targeting local developers. The cross-origin scenario is particularly effective because Mockoon is widely run on local workstations (localhost:3000). If a developer visits a malicious website, client-side scripts running on that site can run silent HTTP requests to the Mockoon port.\n\nmermaid\ngraph LR\n subgraph "Victim Web Browser"\n A["Developer Browser"] -- "1. Navigates to" --> B["Malicious Website"]\n B -- "2. Loads exploit script" --> A\n A -- "3. Executes fetch to localhost" --> C["Local Mockoon Port 3000"]\n end\n subgraph "Local Host"\n C -- "4. Administrative actions executed" --> D["Mockoon Service Process"]\n D -- "5. Responds with wildcard CORS" --> A\n end\n A -- "6. Transmits data to C2" --> E["Attacker Server"]\n\n\nBecause the browser sends local requests, and Mockoon responds with Access-Control-Allow-Origin: *, the browser permits the exploit script to read administrative responses. The script can read transaction logs via /mockoon-admin/logs, extracting active session credentials and API keys.\n\nAn attacker can also inject malicious endpoints by issuing a PUT request to /mockoon-admin/environment. This allows them to dynamically reconfigure the mock server to return phishing content or redirect active client calls to malicious endpoints, compromising other development workflows.

Impact Assessment

The severity score for this vulnerability is 8.8 (High). The primary impact includes complete control over Mockoon's administrative capabilities, allowing attackers to manipulate mock responses and monitor network traffic. This compromise affects developers relying on these mocks for local application validation.\n\nConfidentiality is severely compromised. Since mock servers log standard transactional headers, authentication headers like Bearer tokens, API keys, and cookies are written directly to transaction files. Attackers can exfiltrate these files through the log endpoint, gaining access to production credentials used by clients during testing.\n\nFurthermore, the ability to write arbitrary environment variables provides a path to system compromise. By overwriting process environment variables, an attacker can manipulate application controls or launch arbitrary processes, leading to remote code execution under the privileges of the system user running the Mockoon server.

Remediation and Mitigation

The primary remediation strategy is upgrading all Mockoon clients and libraries to version 9.7.0 or higher. This update resolves the vulnerability by introducing mandatory administrative authentication and restricting permissive CORS settings. The patch also prevents arbitrary environment variable overrides by implementing prefix restrictions.\n\nIf upgrading is not immediately possible, disable the administrative API. This can be achieved by running the Mockoon CLI with the --disable-admin-api flag, or setting enableAdminApi: false in serverless configuration options. Disabling this API prevents administrative routes from mounting, eliminating the attack surface.\n\nIn addition, ensure that the mock service is configured to bind strictly to the loopback interface (127.0.0.1 or ::1) instead of 0.0.0.0. This step prevents external systems from reaching the ports over the network. Setting up localized firewall rules further restricts inbound communication to these development environments.

Official Patches

MockoonFix commit in Mockoon repository

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Probability
0.26%
Top 82% most exploited

Affected Systems

Mockoon Desktop ClientMockoon CLIMockoon Serverless@mockoon/commons-server

Affected Versions Detail

Product
Affected Versions
Fixed Version
Mockoon
Mockoon
< 9.7.09.7.0
AttributeDetail
CWE IDCWE-306, CWE-942, CWE-732, CWE-352
Attack VectorNetwork (AV:N)
CVSS Score8.8 (High)
EPSS Score0.00262 (0.26% probability)
ImpactRemote Code Execution / Environment Pollution / Credential Exfiltration
Exploit StatusProof of Concept
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1189Drive-by Compromise
Initial Access
T1222File and Directory Permissions Modification
Defense Evasion
CWE-306
Missing Authentication for Critical Function

The product does not perform any authentication for a functionality that requires a secure identity or is restricted to a subset of users.

Known Exploits & Detection

GitHub Security AdvisoryOfficial advisory describing the vulnerability and exploit details.

Vulnerability Timeline

Security fix implemented in mockoon/mockoon repository
2026-06-18
Version 9.7.0 released containing security patches; GHSA published
2026-07-09
CVE-2026-59148 record updated in National Vulnerability Database
2026-07-10

References & Sources

  • [1]GHSA-rqx4-3f6q-3x2v
  • [2]Security Patch Commit
  • [3]Security Patch Pull Request
  • [4]Release v9.7.0
  • [5]Mockoon Official Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
8 views•5 min read
•1 day ago•CVE-2026-107848
3.5

CVE-2026-107848: Cross-Site Request Forgery (CSRF) in Contao Backend Actions via GET Requests

Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.

Amit Schendel
Amit Schendel
7 views•5 min read
•1 day ago•CVE-2026-107843
5.3

CVE-2026-107843: Unthrottled Activation Email Resend and Account Enumeration in Contao CMS

Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.

Amit Schendel
Amit Schendel
8 views•4 min read
•1 day ago•CVE-2026-107842
5.3

CVE-2026-107842: Information Disclosure via Stale Indexing in Contao Search Module

An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.

Amit Schendel
Amit Schendel
10 views•4 min read
•1 day ago•GHSA-G38J-7V97-X298
6.5

GHSA-G38J-7V97-X298: Missing Authorization Check in Vikunja CalDAV Task Relation Creation

In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.

Alon Barad
Alon Barad
12 views•5 min read
•1 day ago•GHSA-3HC7-R24J-RPWC
6.8

GHSA-3hc7-r24j-rpwc: Cross-Project Task Disclosure via Subtask Expansion in Vikunja

A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.

Alon Barad
Alon Barad
9 views•5 min read