Electerm versions prior to 5.9.0 have an origin validation vulnerability in the MCP Server widget. This flaw allows remote attackers to bypass Host and Origin checks using DNS rebinding, enabling execution of OS commands locally and on open SSH sessions. The vulnerability is fixed in version 5.9.0.
### Impact
A command injection vulnerability exists in electerm's file system operations (`rmrf`, `mv`, `cp`) in `src/app/lib/fs.js`. These functions construct shell commands by interpolating file paths directly into command strings without escaping shell metacharacters.
**Vulnerable functions:**
- `rmrf()` - Uses `rm -rf "${path}"` (double quotes, vulnerable to `"` injection)
- `mv()` - Uses `mv '${from}' '${to}'` (single quotes, vulnerable to `'` injection)
- `cp()` - Uses `cp -r "${from}" "${to}"` (double quotes, vulnerable to `"` injection)
**Attack scenario:**
1. Attacker controls a malicious SSH/SFTP server
2. Server lists files with shell metacharacters in names (e.g., `file"$(touch /tmp/pwned)"`)
3. Victim connects to the server and performs file operations (remote-to-local transfer, rename on conflict, etc.)
4. The malicious filename is passed to `rmrf()`, `mv()`, or `cp()` without sanitization
5. Shell metacharacters break out of the quoted argument and execute arbitrary commands
**Impact includes:**
- Arbitrary command execution as the electerm desktop user
- Data exfiltration, malware installation, or system compromise
- Both POSIX (bash) and Windows (PowerShell) platforms are affected
### Patches
- https://github.com/electerm/electerm/commit/aa778818843b9c083bd711cd04644d102fcb5a42
### Workarounds
If upgrading is not immediately possible, users can mitigate this vulnerability by:
1. Only connecting to trusted SSH/SFTP servers
2. Avoiding remote-to-local file transfers from untrusted sources
3. Not using the "rename on conflict" option when downloading folders from untrusted servers
4. Manually verifying filenames before performing file operations
### Impact
A path traversal vulnerability exists in the Zmodem and Trzsz file download handlers in electerm. When receiving files via Zmodem or Trzsz protocols, electerm uses the remote-supplied filename directly in `path.join()` with the user-selected download directory without sanitization.
A malicious SSH server or remote shell process can send a specially crafted filename such as `../escaped.txt` to escape the user-selected download directory and write files to arbitrary locations on the user's filesystem, subject to process permissions.
**Attack scenario:**
1. User connects to a malicious SSH server
2. Attacker initiates a Zmodem or Trzsz file transfer
3. Attacker supplies a traversal filename (e.g., `../../.bashrc`, `../escaped.txt`)
4. User accepts the transfer and selects a download directory
5. File is written outside the selected directory, potentially overwriting sensitive files
**Affected components:**
- `src/app/server/zmodem.js` - `prepareReceiveFile()` at line 736
- `src/app/server/trzsz.js` - `getUniqueFilePath()` at line 559, `openSaveFile()` callback, and `savedFilePaths` mapping
### Patches
- https://github.com/electerm/electerm/commit/fde153d677a170c5816368f6586647f3af4ef284
### Workarounds
If upgrading is not immediately possible, users can mitigate this vulnerability by:
1. Only connecting to trusted SSH servers
2. Rejecting or canceling any incoming Zmodem or Trzsz file transfers from untrusted sources
3. Avoiding the use of Zmodem (`sz`/`rz`) and Trzsz (`trz`/`tsz`) commands on untrusted servers
### Impact
_Local code execution without UI interaction: any same-user process can send a JSON payload to electerm's single-instance socket/pipe, causing the app to create tabs and potentially spawn attacker-controlled local processes. Affects electerm single-instance installs on the machine._
### Patches
- https://github.com/electerm/electerm/commit/0599e67069b00e376a2e962649aaad6096e63507
### Workarounds
- Do not run unsafe command
### References
- Report / credit: https://github.com/Curly-Haired-Baboon
- Electerm releases: https://github.com/electerm/electerm/releases
Electerm contains a remote code execution (RCE) vulnerability (CVE-2026-43943) in its SFTP feature that allows opening files with a system or custom editor. The vulnerability arises because filenames received from the SSH server are passed unsanitized into command lines. An attacker controlling the SSH server can craft malicious filenames with shell metacharacters that execute arbitrary commands when the victim opens the file with the vulnerable feature. This can lead to code execution with the user's privileges. The issue is fixed in Electerm version 3.7.9 and later.
Electerm versions up to 3.8.15 expose the entire process.env environment variables to the renderer process via window.pre.env. This includes sensitive secrets such as AWS keys, GitHub tokens, API keys, and internal credentials. Any JavaScript execution in the renderer context, including through malicious plugins or XSS, can access and exfiltrate these secrets. The exposure is visible even without code execution by opening the Info modal, requiring local access. No patch is currently available.
Electerm versions up to 3.8.15 contain a vulnerability in their terminal hyperlink handler where any clicked URL is passed directly to shell.openExternal without protocol validation. This allows an attacker controlling terminal output to craft malicious URIs that, when clicked by the user, can trigger dangerous protocol handlers, open local files or network shares, or launch arbitrary applications. Exploitation requires user interaction (clicking the link) and can lead to arbitrary code execution or local file access. No official patch is available as of version 3.7.9, and users are advised to avoid clicking links from untrusted sources and consider disabling hyperlink rendering or using sandboxing measures.
Electerm versions prior to 3.7.16 contain a critical vulnerability in the runWidget function that allows path traversal leading to arbitrary code execution. The function constructs file paths from unsanitized user input, enabling attackers with JavaScript execution in the renderer process to load and execute arbitrary files on the victim's filesystem. This results in local code execution with full electerm process privileges, potentially compromising the entire system. The issue is fixed in version 3.7.16. Until patched, users should avoid untrusted plugins, loading arbitrary web content, and consider sandboxing electerm to mitigate risk.
A command injection vulnerability exists in electerm versions prior to 3.3.8. The flaw occurs in the runMac() function of the install script, which unsafely incorporates attacker-controlled release metadata into a system command. This allows remote attackers who can manipulate the release metadata to execute arbitrary commands on Mac OS systems during npm installation. The vulnerability has been fixed in version 3.3.8, and users should upgrade to this version or later. No workarounds are available.