Summary
Yamcs' Python algorithm engine previously compiled and executed user-provided algorithm code via Jython without a secure sandbox, allowing arbitrary Java class imports and execution.
An authenticated user with ChangeMissionDatabase privileges could modify existing Python algorithms through the mission database API and achieve remote code execution on the host system.
Affected context
The vulnerability affects Yamcs deployments that:
- Enable Python-based algorithms evaluated via the JSR-223 ScriptEngine
- Allow authenticated users with ChangeMissionDatabase privileges to edit mission database algorithms through REST APIs or UI
- Execute algorithm code within the same JVM as the core mission control services, without a hardened sandbox
The risk is elevated where algorithm execution occurs on mission-critical servers or hosts with broad network or system access.
Exploit preconditions
- Attack surface: Authenticated application interface (mission database REST API or equivalent management UI)
- Required access: Valid Yamcs account with ChangeMissionDatabase privilege (or similar administrative/engineering role)
- Trigger point: Updating an existing Python algorithm's text so that, when compiled and executed, it imports and uses arbitrary Java classes
- Why exploitation is possible: The script engine compiles and runs user-controlled Python code via Jython within the main JVM without sandboxing, allowing direct access to Java runtime APIs from algorithm logic
Why this happens
The core issue stems from executing dynamically provided code without adequate sandboxing or restriction, mapping directly to CWE-94: Improper Control of Generation of Code (Code Injection).
Yamcs' Python algorithm evaluation uses the JSR-223 ScriptEngine with Jython to compile and run algorithm text that is editable by privileged users.
Because the execution environment exposes the full Java classpath and does not enforce a security manager, class whitelist, or restricted execution context, algorithm authors can import and invoke sensitive Java classes (for example, process execution or file I/O).
This creates a situation where configuration-level changes (algorithm edits) effectively become arbitrary code deployment inside the mission control runtime.
Potential impact
- Arbitrary command execution on the underlying host operating system
- Full compromise of the Yamcs server process and its in-memory data
- Unauthorized access to mission telemetry, commanding workflows, or operational data
- Lateral movement within the hosting environment or broader network
- Installation of persistent backdoors or modification of mission logic
General mitigation guidance
Mitigation generally focuses on removing or constraining dynamic code execution and limiting who can alter executable configuration:
- Prefer declarative or configuration-driven algorithms over free-form script execution where feasible
- If scripting is required, use sandboxed interpreters with explicit allowlists of APIs and controlled resource access
- Separate the execution environment of user-editable algorithms from the core mission control JVM, for example via isolated worker processes with reduced privileges
- Restrict the ChangeMissionDatabase (or equivalent) privilege to a minimal set of trusted operators and enforce strong authentication controls
- Introduce change control for mission database modifications, including approvals, code review, and audit logging for algorithm edits
- Apply least-privilege at the OS and container level so that, even if algorithm code is abused, the process has limited system access
How teams detect issues like this
Detection approaches typically combine configuration review, runtime monitoring, and static analysis of algorithm content:
- Periodically review mission database entries for algorithms, looking for suspicious imports, process execution calls, or non-domain-related logic
- Implement static checks or linters for algorithm scripts that flag usage of sensitive Java or system APIs
- Use application audit logs to track who modifies algorithms, with alerts for changes outside normal maintenance windows or by unusual accounts
- Monitor host-level telemetry (process creation, outbound network connections, file modifications) to detect anomalous behavior from the Yamcs process
- Integrate automated security review tools into the mission database change workflow, enforcing policy checks before algorithm updates are deployed

