Electerm Remote Code Execution Vulnerability via Malicious Filenames
A remote code execution vulnerability exists in Electerm versions 3.7.8 and earlier, where a malicious SSH server can inject arbitrary commands into a victim's system by crafting filenames with shell metacharacters that are executed when the user attempts to open or edit the file using the 'open with system editor' or 'edit with custom editor' feature.
Electerm, a terminal/ssh/sftp client, is vulnerable to a remote code execution (RCE) attack (CVE-2026-43943) when using the “open with system editor” or “Edit with custom editor” feature. This vulnerability affects versions 3.7.8 and earlier. A malicious actor who controls the SSH server or has the ability to manipulate filenames can inject shell metacharacters into a filename. When a user attempts to open the file with the vulnerable feature, Electerm passes the filename directly to the command line without sanitization, leading to command execution with the user’s privileges. This allows the attacker to potentially run arbitrary code, install malware, or move laterally within the network. The vulnerability was patched in version 3.7.9.
Attack Chain
- Attacker compromises or sets up a malicious SSH server.
- Attacker creates a file with a specially crafted filename containing shell metacharacters (e.g.,
evil; rm -rf /tmp; touch /tmp/pwned). - Victim connects to the malicious SSH server using Electerm.
- Victim browses the SFTP file system and sees the attacker-controlled filename.
- Victim selects the malicious file and chooses the “open with system editor” or “Edit with custom editor” option.
- Electerm executes a command to open the file, passing the malicious filename unsanitized to the system shell (e.g.,
xdg-open "evil; rm -rf /tmp; touch /tmp/pwned"). - The shell executes the injected commands, deleting files in
/tmpand creating a file named/tmp/pwnedin this example. - Attacker achieves arbitrary code execution on the victim’s machine with the user’s privileges.
Impact
Successful exploitation of this vulnerability allows a malicious actor to execute arbitrary code on the victim’s machine. This could lead to a variety of malicious outcomes, including malware installation, data theft, or lateral movement within the victim’s network. The number of potential victims is limited to Electerm users who connect to untrusted SSH servers and use the vulnerable “open with system editor” or “Edit with custom editor” features. This vulnerability could have significant impact for developers and system administrators who rely on Electerm for remote server management.
Recommendation
- Upgrade Electerm to version 3.7.9 or later to patch CVE-2026-43943.
- Deploy the Sigma rule
Detect Electerm RCE via Filenameto detect exploitation attempts. - Until a patch can be applied, refrain from using the “open with system editor” or “Edit with custom editor” feature when connected to untrusted SSH servers, as recommended in the advisory.
- If the “open with system editor” feature must be used, ensure connections are exclusively established with trusted servers and perform rigorous filename validation before editing.
Detection coverage 2
Detect Electerm RCE via Filename
highDetects CVE-2026-43943 exploitation — execution of shell commands within the Electerm application context due to unsanitized filenames.
Detect Suspicious File Creation from Electerm
mediumDetects file creation in suspicious locations (e.g. /tmp) by Electerm following a potential RCE
Detection queries are available on the platform. Get full rules →