/

CVE-2026-59148

Severity:

HIGH RISK

(8.8)

Unauthenticated Admin API (CWE-306) in Mockoon Server

CVE-2026-59148

Deferred

Vulnerability type

Category:

Missing Authentication and Authorization

CWE:

CWE-306, CWE-352, CWE-732, CWE-942

Impact:

Unauthorized Remote Administrative Access

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Mockoon's mock server exposes an unauthenticated admin API on the same listener as user-defined routes, allowing arbitrary manipulation of environment variables and mock configurations.

Any attacker who can reach the mock server port over the network can read sensitive MOCKOON_* values, rewrite responses, and purge runtime state without prior access or authentication.

Affected context

This vulnerability occurs when Mockoon runtimes expose their mock server port to networks where untrusted clients can connect.

The admin API is mounted on the same Express listener as the mock routes, enabled by default, uses permissive CORS headers, and is not protected by authentication or authorization.

In practice, this affects development, testing, and staging environments where Mockoon is used to simulate APIs, particularly when ports are bound to public or shared interfaces.

Exploit preconditions

  • Attack surface: HTTP admin endpoints (/mockoon-admin/...) served by the Mockoon mock server.
  • Required access: Network reachability to the mock server port; no credentials or prior session needed.
  • Trigger point: Sending crafted HTTP requests (e.g., PUT /mockoon-admin/environment, POST /mockoon-admin/env-vars) to the exposed admin API.
  • Why exploitation is possible: The admin API is enabled by default, shares the same listener as public mock routes, sets Access-Control-Allow-Origin: * with write methods allowed, and lacks authentication and fine-grained authorization checks.

Why this happens

The core issue is a design-level omission of authentication and authorization for powerful administrative endpoints.

Admin functionality that can read and write process environment variables, update mock route definitions, and purge runtime state is exposed on the same public-facing listener as normal API mocks, with permissive CORS configuration and no access control.

This maps to CWE-306 (Missing Authentication for Critical Function) and related weaknesses such as CWE-352 (Cross-Site Request Forgery), CWE-732 (Incorrect Permission Assignment for Critical Resource), and CWE-942 (Overly Permissive Access Control), where sensitive operations are available to any caller able to connect.

Potential impact

  • Attackers may read MOCKOON_* environment variables that could contain secrets or configuration details.
  • Attackers can write arbitrary process environment variables, influencing downstream tools or processes that rely on them.
  • Mock route bodies, statuses, and headers can be rewritten to mislead consumers, poison test data, or mask real issues.
  • Transaction logs and server-sent event streams can be accessed, potentially exposing request metadata or internal behavior.
  • Runtime state (including environment and transaction history) can be purged, disrupting development and testing workflows.
  • In certain deployments, modified mocks and environment variables could be abused in supply-chain or integration testing contexts.

General mitigation guidance

Effective mitigation focuses on enforcing strict access control around administrative capabilities and minimizing exposure of control planes.

Common defensive patterns include:

  • Isolating admin APIs on separate listeners or interfaces that are not publicly exposed and are protected by authentication and authorization.
  • Applying least-privilege principles to administrative operations, ensuring only explicitly authorized users or processes can modify environments and routes.
  • Restricting CORS policies for admin endpoints to trusted origins and avoiding broad Access-Control-Allow-Origin: * for write-capable interfaces.
  • Treating environment variables and mock configuration as sensitive resources, with explicit permission checks before read or write operations.
  • Deploying mock servers behind access-controlled gateways or VPNs rather than exposing them directly to untrusted networks.

How teams detect issues like this

Organizations can detect and monitor similar vulnerabilities through:

  • Static analysis and configuration review for routes or controllers that perform administrative actions but lack authentication and authorization logic.
  • Code review checklists that flag endpoints exposing environment variables, configuration mutation, or logging access on public listeners.
  • Automated policy enforcement (e.g., linting rules or CI checks) requiring access control annotations or middleware on any endpoint marked as "admin" or "management".
  • Network security monitoring to identify unexpected access to administrative paths (such as /mockoon-admin/*) from untrusted sources.
  • Periodic security testing of developer tooling and mock services, including scanning for unauthenticated management interfaces and overly permissive CORS settings.

Sources

SourceLink
github.comgithub.com/mockoon/mockoon/commit/c420b5a56918475b8663977b51e5f986e45b3299
github.comgithub.com/mockoon/mockoon/pull/2254
github.comgithub.com/mockoon/mockoon/releases/tag/v9.7.0
github.comgithub.com/mockoon/mockoon/security/advisories/GHSA-rqx4-3f6q-3x2v
mockoon.commockoon.com/releases/9.7.0

Frequently asked

questions

Yes. Any remote client that can reach the exposed Mockoon server port can call the admin API without authentication, making it remotely exploitable in network-accessible deployments.

Only network access to the mock server. No credentials, tokens, or existing sessions are required; standard HTTP requests to the admin endpoints are sufficient.

Separate administrative functionality from public routes, enforce strong authentication and authorization for admin endpoints, and restrict access to trusted networks or interfaces. Avoid exposing configuration and environment management APIs on publicly reachable ports.

Adopt design-time security reviews for any management or admin features, mandate access control middleware for administrative routes, restrict CORS and network exposure by default, and include checks for unauthenticated control-plane endpoints in CI, code review practices, and security testing.

Find out what's already
exploitable in your codebase.