/

CVE-2026-46562

Severity:

CRITICAL RISK

(9.8)

Script Injection (CWE-94) in Yamcs Algorithm Engine

CVE-2026-46562

Analyzed

Vulnerability type

Category:

Script Injection

CWE:

CWE-94, CWE-95, CWE-470

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.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

Yamcs versions prior to 5.12.7 construct a Nashorn ScriptEngine without a ClassFilter, allowing user-supplied JavaScript algorithms to directly access arbitrary Java classes.

An attacker who can override mission database algorithms can execute arbitrary OS commands as the Yamcs process; in default configurations where the guest user is a superuser, this can be done without authentication.

Affected context

The vulnerability appears in Yamcs deployments that:

  • Use the Java-based Nashorn ScriptEngine for algorithm evaluation
  • Allow algorithm text to be edited through the MdbOverrideApi.updateAlgorithm endpoint
  • Construct the ScriptEngine without a restrictive ClassFilter or equivalent sandboxing
  • Run the Yamcs process with sufficient OS-level privileges to make command execution meaningful

In default configurations lacking a security.yaml, the built-in guest user is configured as a superuser, which effectively exposes this functionality without authentication.

Exploit preconditions

  • Attack surface: HTTP API, specifically the mission database override API (MdbOverrideApi.updateAlgorithm)
  • Required access:
  • Any user account with ChangeMissionDatabase privilege; or
  • In default setups without explicit security configuration, unauthenticated access as the guest user with superuser=true
  • Trigger point: Uploading or modifying an algorithm definition containing malicious JavaScript that the Nashorn engine evaluates at runtime
  • Why exploitation is possible: The Nashorn ScriptEngine is instantiated without a ClassFilter, so user-controlled script code can call Java.type() and similar mechanisms to reach arbitrary Java classes, including those that provide process execution capabilities.

Why this happens

The core issue is the execution of user-controllable script code in an unsandboxed interpreter context.

Yamcs uses Nashorn to evaluate algorithm logic, but the ScriptEngine is created without a ClassFilter or comparable restriction, directly violating secure scripting principles.

This maps to CWE-94: Improper Control of Generation of Code, because attacker-supplied JavaScript is treated as trusted code and executed with full access to the host JVM.

The absence of sandboxing also aligns with CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code) and CWE-470 (Use of Externally-Controlled Input to Select Classes or Code), as the script can dynamically select and invoke powerful Java classes such as java.lang.Runtime.

Potential impact

  • Execution of arbitrary OS commands with the privileges of the Yamcs process
  • Full compromise of the mission control application and its configuration
  • Access to or manipulation of mission data and telemetry streams
  • Use of the Yamcs server as a pivot point for lateral movement inside the network
  • Deployment of persistent backdoors or malware on the underlying host system

General mitigation guidance

Effective mitigation focuses on eliminating unsandboxed script execution and tightening privilege boundaries:

  • Prefer non-scripted, declarative algorithms or precompiled code paths where feasible, to avoid runtime evaluation of user-provided scripts.
  • When scripting is required, instantiate script engines with strong sandboxing:
  • Apply ClassFilter or equivalent mechanisms to block access to sensitive Java packages and classes.
  • Disable or severely restrict APIs like Java.type() that bridge into arbitrary JVM classes.
  • Restrict who can modify mission database algorithms by applying least-privilege principles and separating administrative and operational roles.
  • Treat algorithm text as untrusted input and validate it against allowlists of permitted functions and APIs.
  • Run the Yamcs service under a dedicated OS account with minimal filesystem and process privileges to reduce the blast radius of potential code execution.

How teams detect issues like this

Organizations can detect this class of weakness and its potential exploitation by:

  • Reviewing code paths that create script engines and checking for:
  • Missing or permissive ClassFilter implementations
  • Unrestricted use of eval, dynamically evaluated scripts, or host interop features (e.g., Java.type()).
  • Applying static analysis rules that flag:
  • Instantiation of ScriptEngine (Nashorn or other engines) without sandboxing controls
  • Script execution methods where the source code originates from HTTP parameters, configuration overrides, or user-editable fields.
  • Incorporating secure coding checklists in code review that require:
  • Justification and documentation for each use of dynamic code evaluation
  • Explicit mention of sandbox boundaries and permitted APIs for scripts.
  • Monitoring runtime logs and telemetry for suspicious algorithm changes and script content patterns, such as references to java.lang.Runtime, ProcessBuilder, or other high-risk classes.
  • Using automated SAST/IAST tools that understand Java and common script engines to surface dynamic code evaluation hotspots in CI pipelines.

Sources

SourceLink
github.comgithub.com/yamcs/yamcs/commit/3c550348f866af4675d2ba4a51d8d12b7c7c6011
github.comgithub.com/yamcs/yamcs/commit/4ff8fda642ea8c3309a4d3f379aa77b763148992
github.comgithub.com/yamcs/yamcs/releases/tag/yamcs-5.12.7
github.comgithub.com/yamcs/yamcs/releases/tag/yamcs-5.13.0
github.comgithub.com/yamcs/yamcs/security/advisories/GHSA-vmwp-vh32-rj75

Frequently asked

questions

Yes. The vulnerable functionality is exposed via the HTTP mission database override API, so an attacker who can reach the Yamcs service and invoke the relevant endpoint can exploit it remotely, subject to whatever authentication and authorization controls are in place.

Any principal that can update algorithm definitions is sufficient. In deployments with the default guest user configured as a superuser and no security.yaml, this effectively means no authentication barrier. In hardened environments, the attacker would need credentials or access equivalent to the ChangeMissionDatabase privilege.

The most robust fix is to avoid executing user-supplied scripts altogether for critical logic, replacing them with vetted, precompiled code or tightly constrained configuration. If scripting cannot be removed, the script engine must be strictly sandboxed with a ClassFilter or equivalent, and only an allowlisted set of safe APIs should be available to scripts.

Establish a policy that any dynamic code evaluation or script execution must:

  • Be justified and documented
  • Use hardened sandboxing controls
  • Treat all externally modifiable script sources as untrusted input

Combine this with least-privilege role design, regular reviews of script engine configurations, and automated checks in CI to detect unsandboxed script engine usage before it reaches production.

Find out what's already
exploitable in your codebase.