Summary
A critical code injection vulnerability in Yamcs allows attacker-controlled template arguments from instance creation or update requests to alter generated YAML configuration. When the resulting configuration is loaded, an attacker may register a ProcessRunner service and execute operating-system commands as the Yamcs service account.
Affected context
The vulnerability occurs in Yamcs deployments that incorporate unescaped values from the /api/instances POST endpoint or the /api/instances/{instance} PATCH endpoint into YAML templates. Risk is greatest when the generated configuration is subsequently parsed and loaded as a Yamcs instance configuration, particularly where guest access or instance-creation privileges are available.
Exploit preconditions
- Attack surface: Yamcs HTTP API endpoints for creating or updating instances
- Required access: Guest superuser access in deployments without
security.yaml, or theSystemPrivilege.CreateInstancesprivilege in secured deployments - Trigger point: Template rendering followed by configuration parsing and instance loading
- Why exploitation is possible: User-controlled template arguments are inserted into YAML without context-aware escaping, allowing configuration structure to be changed and a process-execution service to be registered
Why this happens
The underlying bug is improper neutralization of user-controlled data before it is embedded in a YAML document. VarStatement.append inserts template arguments without applying YAML-context escaping, so values intended to be data can become configuration syntax when the rendered document is parsed. This maps primarily to CWE-94: Improper Control of Generation of Code, with related characteristics of CWE-1336: Improper Neutralization of Special Elements Used in a Template and CWE-470: Use of Externally-Controlled Input to Select Classes or Code.
Potential impact
- An attacker may execute arbitrary operating-system commands as the Yamcs service account.
- The Yamcs server process could be compromised.
- Mission-control data and operational workflows could be altered or disrupted.
- Credentials and other resources accessible to the service account could be exposed.
- The compromised deployment could be used for lateral movement, depending on network and host permissions.
General mitigation guidance
Mitigation generally focuses on preventing untrusted values from becoming executable or structural configuration content.
Common defensive patterns include:
- Apply context-aware escaping or structured serialization when inserting values into YAML.
- Prefer typed configuration objects and safe YAML emitters over string-based template construction.
- Validate template arguments against allowlisted schemas before rendering and again after parsing.
- Restrict instance creation and update operations to explicitly authorized principals.
- Avoid exposing privileged guest operations and separate service-management permissions from routine API access.
- Run the Yamcs service with least privilege, limited filesystem access, and narrowly scoped network permissions.
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis rules identifying string concatenation or append operations that place request data into YAML or other structured configuration formats.
- Code review checks for template variables used without context-specific encoding.
- Tests that submit metacharacter-containing values and verify that they remain data after parsing.
- API authorization reviews covering instance creation, instance updates, and guest privileges.
- Runtime monitoring for unexpected instance definitions, newly registered process-execution services, and child processes launched by the Yamcs service account.
- Policy enforcement that requires schema validation and approved service types before configurations are loaded.
Automated application-security and code-review tools may help identify unsafe template construction and externally controlled class or service selection.

