Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @mockoon/commons-server
  4. ›
  5. CVE-2026-59148

CVE-2026-59148: @Mockoon/commons-server: Unauthenticated admin API + wildcard CORS allows mock-state hijack and secret theft

September 11, 2026

Mockoon’s admin API (commons-server/src/libs/server/admin-api.ts) is mounted on the same Express listener as the user-defined mock routes, enabled by default in every shipped runtime (commons-server, CLI, serverless), serves Access-Control-Allow-Origin: * on every endpoint with all HTTP methods allowed including PUT/POST/PATCH/DELETE/PURGE and Content-Type in Access-Control-Allow-Headers, and has zero authentication of any kind (no token, no shared secret, no MOCKOON_ADMIN_TOKEN env var — searched the repo, returns zero hits).

Any unauthenticated caller who can reach the mock server’s port (default 0.0.0.0:3000) can:

  • Read every MOCKOON_* env var used by the operator as secret material in templates (getEnvVar helper).
  • Write arbitrary process env vars (no prefix check on the WRITE path) — poison operator’s MOCKOON_API_KEY, MOCKOON_JWT_SECRET, …, or write process-level vars like AWS_SECRET_ACCESS_KEY that the surrounding runtime consumes.
  • Rewrite every mock route’s body / status / headers in-runtime via PUT /mockoon-admin/environment — downstream consumers (frontend dev-server, CI test suite, integration partner) receive attacker-controlled responses and headers including Set-Cookie, Location, Content-Security-Policy, etc.
  • Read transaction logs / SSE stream (consumer’s request bodies + auth headers in clear).
  • Read/write global template vars; purge state / data buckets / logs.

Because of the wildcard CORS reply, the attack also lands cross-origin from a browser: a developer who runs mockoon-cli start ... locally and visits a malicious website gets their mock state hijacked.


References

  • github.com/advisories/GHSA-rqx4-3f6q-3x2v
  • github.com/mockoon/mockoon/commit/c420b5a56918475b8663977b51e5f986e45b3299
  • github.com/mockoon/mockoon/pull/2254
  • github.com/mockoon/mockoon/releases/tag/v9.7.0
  • github.com/mockoon/mockoon/security/advisories/GHSA-rqx4-3f6q-3x2v
  • mockoon.com/releases/9.7.0
  • nvd.nist.gov/vuln/detail/CVE-2026-59148

Code Behaviors & Features

Detect and mitigate CVE-2026-59148 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 9.7.0

Fixed versions

  • 9.7.0

Solution

Upgrade to version 9.7.0 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-306: Missing Authentication for Critical Function
  • CWE-352: Cross-Site Request Forgery (CSRF)
  • CWE-732: Incorrect Permission Assignment for Critical Resource
  • CWE-942: Permissive Cross-domain Policy with Untrusted Domains

Source file

npm/@mockoon/commons-server/CVE-2026-59148.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 12 Sep 2026 00:18:37 +0000.