Executive brief
Yamcs is a space mission control system that processes telemetry data using a query language called StreamSQL. The system dynamically compiles StreamSQL queries to Java bytecode but fails to sanitize column names before inserting them into the generated code. An authenticated operator with archive-management privileges can craft a malicious column name containing Java code, which executes with the privileges of the Yamcs server process, allowing complete compromise of mission data, telemetry tampering, and lateral movement into the host environment.
Technical details
The vulnerability is a code-injection flaw in the StreamSQL expression compiler (org.yamcs.yarch.streamsql). When compiling aggregate functions like sum(...), Yamcs interpolates column names unescaped into generated Java source code. The sanitizeName() function only removes forward-slashes and hyphens, leaving characters like semicolons, parentheses, and braces intact. This allows an attacker to break out of the identifier context and inject arbitrary Java statements. Unlike the bare-expression compiler (which has an accidental mitigation), the aggregate compiler lacks a return statement that would cause injected code to be flagged as unreachable, making arbitrary code execution possible. An authenticated attacker with SystemPrivilege.ControlArchiving can exploit this via POST /api/archive/{instance}:executeSql by creating a table with a malicious column name (e.g., containing java.io.File().mkdirs() or other JDK APIs) and executing a SELECT sum(...) query that triggers compilation and execution of the injected code. Patches are available in versions 5.13.2 and 5.12.8.
Affected products
- Yamcs yamcs-core >=5.13.0, <=5.13.1 and <=5.12.7
Timeline
- 2026-07-14: disclosed: Published in GitHub Advisory Database
- 2026-08-28: advisory: Advisory updated with additional technical details
- 2026-08-28: patched: Patches released in versions 5.13.2 and 5.12.8