{"vuln_id":"GHSA-3p24-9x7v-7789","aliases":["CVE-2026-35582"],"description":"Emissary has an OS Command Injection via Unvalidated IN_FILE_ENDING / OUT_FILE_ENDING in Executrix","published_at":"2026-04-13T16:38:25Z","modified_at":"2026-11-20T05:17:07Z","first_seen_at":"2026-11-21T19:15:19.296908Z","severity":"high","severity_source":"ghsa","cvss_score":8.8,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","cwe":["CWE-78","CWE-116"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-3p24-9x7v-7789"},"matched_alias":null,"items":[{"id":2317,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-3p24-9x7v-7789 / CVE-2026-35582: Emissary has an OS Command Injection via Unvalidated IN_FILE_ENDING / OUT_FILE_ENDING in Executrix","summary":"Emissary has an OS Command Injection via Unvalidated IN_FILE_ENDING / OUT_FILE_ENDING in Executrix\n\n### Summary\n\n`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.\n\nThis 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.\n\n---\n\n### Root Cause\n\n#### Step 1 — `IN_FILE_ENDING` flows into temp path construction without validation\n\n**[`TempFileNames.java:32-36`](src/main/java/emissary/util/shell/TempFileNames.java#L32-L36)**\n\n```java\npublic TempFileNames(String tmpDir, String placeName, String inFileEnding, String outFileEnding) {\nbase = Long.toString(System.nanoTime());\ntempDir = FileManipulator.mkTempFile(tmpDir, placeName);\nin = base + inFileEnding; // no sanitization\nout = base + outFileEnding; // no sanitization\nbasePath = tempDir + File.separator + base;\ninputFilename = basePath + inFileEnding; // injected value lands here\noutputFilename = basePath + outFileEnding; // and here\n}\n```\n\n`inFileEnding` is concatenated directly onto a numeric base to produce `inputFilename`. No character class, no regex, no escaping.\n\n#### Step 2 — The injected path is substituted verbatim into a shell string\n\n**[`Executrix.java:1053-1065`](src/main/java/emissary/util/shell/Executrix.java#L1053-L1065)**\n\n```java\npublic String[] getCommand(final String[] tmpNames, final String commandArg,\nfinal int cpuLimit, final int vmSzLimit) {\nString c = commandArg;\nc = c.replaceAll(\"\n\", tmpNames[INPATH]); // contains inFileEnding verbatim\nc = c.replaceAll(\"\n\", tmpNames[OUTPATH]);\nc = c.replaceAll(\"\n\", tmpNames[IN]);\nc = c.replaceAll(\"\n\", tmpNames[OUT]);\n\nString ulimitv = \"\";\nif (!SystemUtils.IS_OS_MAC) {\nulimitv = \"ulimit -v \" + vmSzLimit + \"; \";\n}\nreturn new String[] {\"/bin/sh\", \"-c\",\n\"ulimit -c 0; \" + ulimitv + \"cd \" + tmpNames[DIR] + \"; \" + c};\n}\n```\n\nThe final array element is passed to `/bin/sh -c`. Shell metacharacters in any substituted value are interpreted by the shell.\n\nThe identical pattern exists in the `TempFileNames` overload at **[`Executrix.java:1103-1115`](src/main/java/emissary/util/shell/Executrix.java#L1103-L1115)**.\n\n#### Step 3 — `setInFileEnding()` and `setOutFileEnding()` perform no validation\n\n**[`Executrix.java:1176-1196`](src/main/java/emissary/util/shell/Executrix.java#L1176-L1196)**\n\n```java\npublic void setInFileEnding(final String argInFileEnding) {\nthis.inFileEnding\n\nAffected packages: maven:gov.nsa.emissary:emissary\nPatched: gov.nsa.emissary:emissary 8.43.0","url":"https://github.com/advisories/GHSA-3p24-9x7v-7789","published_at":"2026-04-13T16:38:25Z","updated_at":"2026-11-20T05:17:07Z","fetched_at":"2026-11-21T19:15:18.416745Z","severity":"high","cvss_score":8.8,"epss":0.00876,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"gov.nsa.emissary:emissary","vuln_id":"CVE-2026-35582","vuln_ids":["CVE-2026-35582","GHSA-3P24-9X7V-7789"],"tags":["ghsa","maven","CWE-78","CWE-116"],"cluster_id":2056,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2317","html":"https://vulnwatch.ve1ve2.com/item/2317"}}]}