-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The patch does not sandbox Jython\n\nGHSA-2g95-6x5q-xjwj names `org.yamcs.algorithms.AlgorithmManager` and the runtime endpoint `PATCH /api/mdb/{instance}/{processor}/algorithms/{name}`. Yamcs is the open-source mission control system maintained by Space Applications Services for spacecraft operators, ground-segment integrators, and university teams that need an end-to-end satellite control stack. The endpoint lets an authenticated caller holding `SystemPrivilege.ChangeMissionDatabase` replace the source text of a running Python algorithm. Pablo Picurelli Ortiz, a cybersecurity student at Universidad Rey Juan Carlos, replaced it with two lines:\n\n```python\nimport java.lang.Runtime\njava.lang.Runtime.getRuntime().exec([\"bash\", \"-c\", \"\"])\nout0.value = 1.0\n```\n\nThe chain works because Yamcs's `ScriptAlgorithmExecutorFactory` builds the algorithm function and hands the result to a JSR-223 engine. The relevant lines in `yamcs-core/src/main/java/org/yamcs/algorithms/ScriptAlgorithmExecutorFactory.java`:\n\n```java\nscriptEngine.put(ScriptEngine.FILENAME, calg.getQualifiedName());\nscriptEngine.eval(functionScript);\n```\n\nThe Jython implementation of `javax.script.ScriptEngine` evaluates Python source. Python source under Jython can `import java.lang.Runtime`. No layer between the caller's text and the engine inspects, rewrites, or constrains the source. The advisory's curl is the contract executing as documented.\n\nCommit `4ff8fda`, dated May 2, 2026, authored by Fabian Diet at Space Applications Services, is the fix. The diff against `JavaAlgorithmEngine.java` is a typo correction (`lanaguage` to `language`). The diff against `JavaExprAlgorithmExecutionFactory.java` is an unused-cast suppression and trailing-whitespace removal. There is no diff that touches `ScriptAlgorithmExecutorFactory.java`. There is no diff that wraps `scriptEngine.eval`. There is no diff that filters the algorithm text. The fix lives in `yamcs-core/src/main/java/org/yamcs/http/api/MdbOverrideApi.java`:\n\n```java\nctx.checkSystemPrivilege(SystemPrivilege.ChangeMissionDatabase);\n\nProcessor processor = ProcessingApi.verifyProcessor(request.getInstance(), request.getProcessor());\n\nList l = processor.getServices(AlgorithmManager.class);\n// ...\nCustomAlgorithm calg = (CustomAlgorithm) a;\n\nif (!processor.getConfig().isOverrideAlgorithmsEnabled()) {\n throw new MethodNotAllowedException(\"Capability to update algorithms is not enabled\");\n}\n\nswitch (request.getAction()) {\ncase RESET:\n algMng.clearAlgorithmOverride(calg);\n break;\ncase SET:\n // ...\n algMng.overrideAlgorithm(calg, ai.getText());\n```\n\nInserted between the existing privilege check and the call into `algMng.overrideAlgorithm(calg, ai.getText())`. The endpoint is still routed. The privilege check still runs. The call site for `eval` is untouched. The boolean refuses the request before the chain begins.\n\n## The injected code fires on the next telemetry frame\n\nA Yamcs custom algorithm is not invoked by the API caller. It is a definition the processor binds to a set of input parameters; whenever any of those parameters receives a new telemetry value, the algorithm executes against that value to derive an output parameter. The realtime processor is the one that ingests live telemetry from the spacecraft link, and the algorithms registered against it run on every frame.\n\nThat is what the advisory's last sentence means when it says \"the injected payload executes when telemetry data triggers algorithm evaluation.\" The attacker does not need to call the algorithm. The attacker writes the function body and waits. The next downlink frame containing one of the algorithm's input parameters causes the processor to call the function. The function holds `java.lang.Runtime.getRuntime().exec`. The shell runs as the Yamcs JVM's user, on the host running mission control, against the network the host can reach.\n\nThe operator who notices the breach is whoever owns the realtime processor's console on the shift that telemetry arrived. The Yamcs JVM's host is, in production deployments of this product, the machine that ingests CCSDS frames from the antenna gateway and forwards commands to it. In test deployments it is a developer laptop. The patch makes both default to refusing the call. The patch does not separate them.\n\n## Three CVE numbers, one commit, one default\n\nThe commit message lists three CVEs:\n\n```\nDisable algorithm edit\n\nWhen used in an uncontrolled environment this capability\ncould be exploited for RCE.\n\nGHSA-524g-x36v-9wm6\nCVE-2026-44632\n\nGHSA-2g95-6x5q-xjwj\nCVE-2026-46621\n\nGHSA-vmwp-vh32-rj75\nCVE-2026-46562\n```\n\nEach CVE names a different script language reachable through the same endpoint. The Java case (CVE-2026-44632) reaches `JavaAlgorithmEngine`, which dispatches to `JavaExprAlgorithmExecutionFactory` and compiles `org.yamcs.algorithms.javaexpr.` from the algorithm text via Janino's `SimpleCompiler`. The Jython case (CVE-2026-46621) reaches `ScriptAlgorithmExecutorFactory` with `language=\"python\"`. The JavaScript case (CVE-2026-46562) reaches the same factory with `language=\"JavaScript\"` and whichever Nashorn or Rhino engine the classpath surfaces. All three executors live under `org.yamcs.algorithms`. All three are constructed from the same `algMng.overrideAlgorithm(calg, ai.getText())` call. All three are closed by the same boolean.\n\nYamcs is not patching three vulnerabilities. Yamcs is patching one capability that produces three CVE numbers because it has three language back ends.\n\n## The privilege is named for the data\n\nYamcs's authorization model gates the endpoint with `SystemPrivilege.ChangeMissionDatabase`. The mission database (MDB) is the XTCE-derived structure that holds the project's parameters, containers, command definitions, and algorithms. The privilege grants permission to modify any of those. Algorithms are one element of the MDB. Algorithm text is one field of the algorithm element.\n\n`ChangeMissionDatabase` is the privilege a mission-operations engineer carries. It is a role-level grant; in a typical deployment, the MDB engineer, the instrument lead, and the on-console operator on a flight day all hold it. The privilege's name describes the data the holder may change. It does not say \"may execute arbitrary code in the Yamcs JVM.\"\n\nThe 5.12.7 patch does not rename the privilege. It does not split off a new `ExecuteAlgorithmText` permission. It does not narrow the privilege check at all. It carves a hole out of `ChangeMissionDatabase` by adding a configuration the operator sets, in a file the operator owns, gating the part of the privilege the vendor has now classified as a capability the privilege should not have granted. Through 5.12.6 the privilege did grant it.\n\nThe integration-test config in the same commit flips the flag back on so the existing test suite continues to exercise the path:\n\n```yaml\nrealtime:\n # ...\n recordInitialValues: true\n recordLocalValues: true\n overrideAlgorithmsEnabled: true\n```\n\nThe shipped production default does not.\n\n## The documentation labels the bug as inherent\n\nThe same commit adds a section to `docs/server-manual/processors/processor-configuration.rst`:\n\n```\noverrideAlgorithmsEnabled (boolean)\n If set to true, users with ``ChangeMissionDatabase`` system privilege can update\n an algorithm script at runtime.\n\n .. warning::\n This is disabled by default to avoid the inherent risk of Remote Code Execution (RCE).\n\n Default: ``false``\n```\n\n\"Inherent risk of Remote Code Execution\" is the vendor's prose. The risk is named \"inherent\" because the algorithm engine's contract is to evaluate user-supplied script text. Yamcs's algorithms are scripts. Scripts execute. There is no edit that closes the action without removing the feature.\n\nThe commit message frames the same conclusion in eight words. \"When used in an uncontrolled environment this capability could be exploited for RCE.\" The vendor's vocabulary distinguishes the capability from the bug. The capability is what the endpoint does. The bug is the gap between the capability and the deployment that holds it. 5.12.7 closes the gap by removing the capability from the default deployment.\n\nA real sandbox is not absent because nobody knew how to build one. Jython publishes a class-loader API for the JSR-223 engine that lets the host restrict which Java packages the script may import. A subclass of `JythonScriptEngineFactory` with a constrained `PySystemState` can refuse `java.lang.Runtime` at import time. The patch does not reach for that interface. The patch's choice is structurally simpler: the operator decides whether the endpoint is reachable at all, and the default is no.\n\n## The algorithm engine's job is to evaluate user-supplied script text\n\nThis is the Unpatchable Primitive shape at the configuration boundary. The primitive runs `MdbOverrideApi.updateAlgorithm` to `AlgorithmManager.overrideAlgorithm` to `factory.makeExecutor(algOverr, globalCtx)` to `scriptEngine.eval(functionScript)`. The primitive cannot be removed without removing the runtime-edit capability the algorithm system is designed around. Some Yamcs deployments use runtime algorithm edits because the operational model requires it; the feature exists for them. 5.12.7 shifts the primitive from default-on to default-off.\n\nThis is a different shape of unpatchable primitive from the runtime-bypass layer ([vm2 ships per-feature wraps that grow with each ECMAScript edition](/posts/vm2-cve-2026-24118-resetpromisespecies-has-a-sibling), [Langflow's `exec()` reaches the same call site through different arrival channels](/posts/langflow-flow-id-authorized-data-ran)). Those defenses accrete inside the substrate. Yamcs's defense disowns the capability by configuration. The capability remains in the codebase, the endpoint remains on the URL surface, the privilege check remains in the handler. The boolean refuses the call.\n\nAn operator who enables `overrideAlgorithmsEnabled: true` because the workflow requires runtime algorithm edits restores the entire CVE chain by setting one line in YAML. The Yamcs instance running with the flag on is, by the vendor's own commit message, an \"uncontrolled environment.\" The instance running with the flag off is one configuration directive away from being one.\n\nThe 5.12.7 release notes count three CVEs fixed. The diff that fixes them is one if-statement and one default.\n\nPoC: [GHSA-2g95-6x5q-xjwj](https://github.com/advisories/GHSA-2g95-6x5q-xjwj)\n","closing_line":"The interpreter is unchanged. The endpoint is unchanged. The privilege is unchanged. The capability is opt-in.","hook_md":"The patch for CVE-2026-46621 is `boolean overrideAlgorithmsEnabled = false;`. It is added to `ProcessorConfig.java` in commit `4ff8fda`. The same boolean closes CVE-2026-44632 and CVE-2026-46562 in the same commit. The diff does not sandbox Jython, does not filter the algorithm text, and does not touch the `eval` call site.","post_id":515,"slug":"yamcs-cve-2026-46621-three-cves-one-boolean","title":"CVE-2026-46621: Three CVEs, One Boolean. Yamcs Patched Its Algorithm Engine By Defaulting The Capability Off.","type":"initial","unreadable_sentence":"The 5.12.7 release notes count three CVEs fixed; the diff that fixes them is one if-statement and one default."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCaotOqwAKCRDeZjl4jgkQ Jt7TAP0d8VZRooePqJ18WwWhOhud1GAa6B4csDs9NperKFBxDwD/ViyRxx/KJ3oB /4aauDNdDPp2fjsgQtey68y7Fvk4XwM= =jBTD -----END PGP SIGNATURE-----