Executive brief
Electerm is a terminal emulator that allows users to edit remote files via SFTP using their system editor. A vulnerability in the "open with editor" feature fails to sanitize filenames, allowing an attacker controlling an SSH server to inject shell commands. An unsuspecting user who attempts to edit a crafted filename would execute arbitrary code with their privileges, potentially leading to malware installation or lateral movement within a network.
Technical details
The vulnerability is a classic OS command injection (CWE-78) and argument injection (CWE-88) flaw in the SFTP file editor feature. When a user selects "open with system editor" or "edit with custom editor," the filename is directly passed to the shell without sanitization or proper escaping. An attacker who controls the SSH server can craft a filename containing shell metacharacters (e.g., backticks, pipes, semicolons) that are interpreted as commands when the filename is passed to exec. The attack requires local file system access or control of the SSH server, and user interaction (the victim must attempt to edit the file). Fixed in version 3.7.9 via commit 24ce7103e264cffe6eb5476c0506a2379e6f8333.
Affected products
- Electerm Electerm <=3.7.8
Timeline
- 2026-05-08: disclosed
- 2026-05-08: patched: Fixed in version 3.7.9