CVE-2026-43943: electerm: RCE via malicious SSH server filename in openFileWithEditor
Impact
A code execution (RCE) vulnerability exists in electerm's SFTP open with system editor or "Edit with custom editor" feature. When a user opts to edit a file using open with system editor or open with a custom editor, the filename is passed directly into a command line without sanitization.
A malicious actor controlling the SSH server or user OS can exploit this by crafting a filename containing shell metacharacters. If a victim subsequently attempts to edit this file, the injected commands are executed on their machine with the user's privileges. This could allow the attacker to run arbitrary code, install malware, or move laterally within the network.
<img width="1792" height="817" alt="1" src="https://github.com/user-attachments/assets/ddf78890-e95d-4fe7-981e-f86887677e8b" /> <img width="1648" height="941" alt="2" src="https://github.com/user-attachments/assets/cca2295b-2053-4d99-a464-be51eac2f5be" />
Patches
Fixed in version >= 3.7.9
- https://github.com/electerm/electerm/commit/24ce7103e264cffe6eb5476c0506a2379e6f8333
Workarounds
Until a patch is available, it is strongly recommended to: - Refrain from using the open with system editor or "Edit with custom editor" feature when connected to untrusted or unfamiliar SSH servers. - Consider using the built-in editor for viewing files, as this path may not be vulnerable to the same injection. - If the feature must be used, ensure connections are exclusively established with trusted servers and perform rigorous filename validation before editing.
Resources
- electerm GitHub Repository
Other sources
electerm is an open-sourced terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp client. Prior to version 3.7.9, a code execution (RCE) vulnerability exists in electerm's SFTP open with system editor or "Edit with custom editor" feature. When a user opts to edit a file using open with system editor or open with a custom editor, the filename is passed directly into a command line without sanitization. A malicious actor controlling the SSH server or user OS can exploit this by crafting a filename containing shell metacharacters. If a victim subsequently attempts to edit this file, the injected commands are executed on their machine with the user's privileges. This could allow the attacker to run arbitrary code, install malware, or move laterally within the network. This issue has been patched in version 3.7.9.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-43943?
CVE-2026-43943 is classified as a remote code execution (RCE) vulnerability that could potentially allow an attacker to execute arbitrary code on the affected system.
How do I fix CVE-2026-43943?
To mitigate CVE-2026-43943, upgrade electerm to version 3.7.9 or later, where the vulnerability has been addressed.
What versions of electerm are affected by CVE-2026-43943?
CVE-2026-43943 affects electerm versions prior to 3.7.9.
What causes CVE-2026-43943?
CVE-2026-43943 is caused by handling a malicious SSH server filename when using the openFileWithEditor feature in electerm.
Is there any workaround for CVE-2026-43943?
While upgrading is the recommended solution for CVE-2026-43943, users may temporarily avoid using the openFileWithEditor functionality until the software is updated.