/

CVE-2026-27574

Severity:

CRITICAL RISK

(9.9)

Code Injection / Arbitrary Code Execution in OneUptime

CVE-2026-27574

Analyzed

Vulnerability type

Category:

Code Injection / Arbitrary Code Execution

CWE:

CWE-94

Impact:

Remote Code Execution and Full Cluster Compromise

Severity:

CRITICAL RISK

(9.9)

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

OneUptime's custom JavaScript monitor feature executes user-supplied code using Node.js's vm module, which is not a security boundary and permits trivial sandbox escape.

When combined with default open registration and low-role access to monitor creation, an attacker can run arbitrary code with access to host networking and all cluster credentials, leading to rapid full-environment compromise.

Affected context

This vulnerability appears in OneUptime deployments that:

  • Enable the custom JavaScript monitor feature
  • Execute user-provided JavaScript on backend probes using Node.js's vm module
  • Run probes with host networking and sensitive credentials exposed via environment variables
  • Allow self-service or open registration, where the baseline role (e.g., ProjectMember) is permitted to create monitors

In such environments, user-supplied monitor code is effectively treated as trusted logic despite originating from low-trust or anonymous users.

Exploit preconditions

  • Attack surface: Public web interface / API for creating custom JavaScript monitors.
  • Required access: Ability to sign up as a user in a project (open registration enabled by default) and obtain the lowest role that can create monitors (ProjectMember).
  • Trigger point: Saving or executing a custom JavaScript monitor causes the backend probe to run attacker-controlled code inside a Node.js vm context.
  • Why exploitation is possible:
  • The Node.js node:vm module is used as if it provides isolation, but it is explicitly not a security sandbox.
  • Well-known one-liner patterns allow immediate escape from the vm context to the underlying process.
  • The probe process runs with host networking and exports highly privileged secrets (e.g., ONEUPTIME_SECRET, DATABASE_PASSWORD, REDIS_PASSWORD, CLICKHOUSE_PASSWORD) as environment variables.
  • As a result, arbitrary code execution occurs with full access to the runtime environment and the surrounding cluster.

Why this happens

The core issue is treating a non-security mechanism (node:vm) as a secure sandbox for untrusted code.

From a vulnerability-class perspective, this maps to CWE-94: Improper Control of Generation of Code (Code Injection), because the system directly executes user-provided JavaScript as part of its normal operation without a true isolation boundary. The design assumes that vm can contain or limit the behavior of untrusted code, but the API is not meant to enforce security constraints. Consequently:

  • Untrusted code is granted execution within the same process as trusted logic.
  • The code can trivially access process-level constructs (e.g., process, require, global objects) using well-known escape techniques.
  • Once the attacker reaches the real Node.js runtime, they can read environment variables, initiate network connections, or interact with the filesystem.

Conceptually, the bug is an insecure execution environment: untrusted code is executed as if it were confined, but in reality it runs with the full authority of the service.

Potential impact

  • Remote execution of arbitrary OS-level commands via Node.js primitives.
  • Exfiltration of all cluster credentials stored in environment variables (e.g., application secrets, database, Redis, ClickHouse credentials).
  • Full compromise of the OneUptime monitoring cluster, including configuration, stored data, and future telemetry.
  • Lateral movement into connected services and databases using stolen credentials.
  • Persistent backdoors, data manipulation, or log tampering through the compromised monitoring infrastructure.
  • Abuse of host networking to pivot into internal-only services or perform internal scanning.

General mitigation guidance

Effective mitigation centers on eliminating the execution of untrusted code in non-hardened environments and enforcing strict privilege boundaries:

  • Avoid treating node:vm or similar runtime features as security sandboxes. If untrusted code must be supported, execute it in separate, unprivileged, and tightly isolated processes or containers with narrowly scoped capabilities.
  • Apply principle of least privilege to probe components:
  • Remove unnecessary host networking where possible.
  • Restrict environment variables and secrets exposed to the monitoring runtime.
  • Use dedicated, minimally privileged credentials for each subsystem instead of cluster-wide secrets.
  • Introduce capability-based controls for user-defined scripts:
  • Limit which roles can define or modify executable monitors.
  • Require administrative approval or review for arbitrary code monitors.
  • Prefer declarative, configuration-driven checks over free-form scripting where feasible.
  • Implement strong multi-tenant isolation so that compromise of one project's scripts does not grant access to global or cross-tenant resources.
  • Provide safer alternatives for extensibility, such as predefined templates, domain-specific languages (DSLs), or restricted, validated expressions instead of arbitrary JavaScript.

How teams detect issues like this

Detection should focus on both proactive code analysis and runtime monitoring:

  • Static analysis and code review:
  • Flag any use of node:vm, eval, Function, or similar dynamic execution primitives that process user-controlled input.
  • Identify code paths where user-supplied monitor definitions are stored and later executed server-side.
  • Enforce review policies requiring security sign-off for features that execute user-provided logic.
  • Automated tooling:
  • Use static application security testing (SAST) tools configured with rules to detect dangerous JavaScript execution patterns and untrusted-code execution.
  • Integrate custom linting rules into CI pipelines to prevent reintroduction of unsandboxed script execution.
  • Runtime and operational signals:
  • Monitor probe processes for unusual outbound network connections or unexpected destinations.
  • Log and inspect high-risk monitor definitions, especially those containing dynamic imports, filesystem access attempts, or environment variable access.
  • Track account creation rates and unusual patterns of monitor creation that might indicate automated exploitation attempts.
  • Policy enforcement:
  • Apply organizational rules that prohibit running untrusted user code in privileged components.
  • Periodically audit services that advertise "custom scripting" or "user-defined logic" for proper isolation controls.

Sources

SourceLink
github.comgithub.com/OneUptime/oneuptime/commit/7f9ed4d43945574702a26b7c206e38cc344fe427
github.comgithub.com/OneUptime/oneuptime/security/advisories/GHSA-v264-xqh4-9xmm

Frequently asked

questions

Yes. When open registration is enabled (the default), an unauthenticated user can sign up, gain the lowest role (ProjectMember), create a custom JavaScript monitor, and immediately execute arbitrary code through the backend probe.

The attacker only needs the ability to create or modify custom JavaScript monitors. In typical deployments, this is available to low-privilege project members and can often be reached by any new registrant if self-service registration is not restricted.

The safest approach is to eliminate execution of untrusted, arbitrary JavaScript in privileged components. If extensibility is required, run user code in a separate, heavily sandboxed environment with minimal permissions, or replace arbitrary scripting with constrained, declarative configurations or a limited DSL.

Avoid assuming language runtime features (like node:vm) provide security isolation; treat any untrusted code execution as a high-risk design that requires strong OS-level or container isolation. Combine this with strict least-privilege for runtime processes, careful exposure of secrets, role-based access control for "custom code" features, and automated checks in CI to flag unsafe dynamic execution paths.

Find out what's already
exploitable in your codebase.