{"id":"CVE-2026-49255","aliases":["CVE-2026-49255","GHSA-v5ff-xmfp-p245"],"related":[],"kind":"vulnerability","state":"published","title":"electerm: Command Injection in File System Operations (rmrf, mv, cp)","summary":"electerm is an open-sourced terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp client. Prior to 3.11.11, electerm constructs operating system commands in src/app/lib/fs.js by interpolating untrusted file paths into the rmrf(), mv(), and cp() functions. A malicious SSH or SFTP server can provide a filename containing quote characters and shell metacharacters, and a victim can cause that filename to reach the affected operation during remote-to-local transfer, conflict renaming, copying, moving, or removal. The generated `rm -rf`, mv, `cp -r`, PowerShell Remove-Item, Move-Item, or Copy-Item command can then interpret the filename as shell syntax. This allows arbitrary command execution with the electerm desktop user's privileges on POSIX and Windows systems, enabling data exfiltration, file modification, malware installation, or denial of service. This issue is fixed in version 3.11.11.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"electerm is an open-sourced terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp client. Prior to 3.11.11, electerm constructs operating system commands in src/app/lib/fs.js by interpolating untrusted file paths into the rmrf(), mv(), and cp() functions. A malicious SSH or SFTP server can provide a filename containing quote characters and shell metacharacters, and a victim can cause that filename to reach the affected operation during remote-to-local transfer, conflict renaming, copying, moving, or removal. The generated `rm -rf`, mv, `cp -r`, PowerShell Remove-Item, Move-Item, or Copy-Item command can then interpret the filename as shell syntax. This allows arbitrary command execution with the electerm desktop user's privileges on POSIX and Windows systems, enabling data exfiltration, file modification, malware installation, or denial of service. This issue is fixed in version 3.11.11.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA 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.\n\n**Vulnerable functions:**\n- `rmrf()` - Uses `rm -rf \"${path}\"` (double quotes, vulnerable to `\"` injection)\n- `mv()` - Uses `mv '${from}' '${to}'` (single quotes, vulnerable to `'` injection)\n- `cp()` - Uses `cp -r \"${from}\" \"${to}\"` (double quotes, vulnerable to `\"` injection)\n\n**Attack scenario:**\n1. Attacker controls a malicious SSH/SFTP server\n2. Server lists files with shell metacharacters in names (e.g., `file\"$(touch /tmp/pwned)\"`)\n3. Victim connects to the server and performs file operations (remote-to-local transfer, rename on conflict, etc.)\n4. The malicious filename is passed to `rmrf()`, `mv()`, or `cp()` without sanitization\n5. Shell metacharacters break out of the quoted argument and execute arbitrary commands\n\n**Impact includes:**\n- Arbitrary command execution as the electerm desktop user\n- Data exfiltration, malware installation, or system compromise\n- Both POSIX (bash) and Windows (PowerShell) platforms are affected\n\n### Patches\n\n- https://github.com/electerm/electerm/commit/aa778818843b9c083bd711cd04644d102fcb5a42\n\n### Workarounds\n\nIf upgrading is not immediately possible, users can mitigate this vulnerability by:\n1. Only connecting to trusted SSH/SFTP servers\n2. Avoiding remote-to-local file transfers from untrusted sources\n3. Not using the \"rename on conflict\" option when downloading folders from untrusted servers\n4. Manually verifying filenames before performing file operations","format":"markdown","source":"ghsa"},{"lang":"es","text":"electerm es un cliente de terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp de código abierto. Antes de la versión 3.11.11, electerm construye comandos del sistema operativo en src/app/lib/fs.js interpolando rutas de archivo no confiables en las funciones rmrf(), mv() y cp(). Un servidor SSH o SFTP malicioso puede proporcionar un nombre de archivo que contenga caracteres de comillas y metacaracteres de shell, y una víctima puede hacer que ese nombre de archivo llegue a la operación afectada durante la transferencia remota a local, el cambio de nombre por conflicto, la copia, el movimiento o la eliminación. El comando generado ’rm -rf’, mv, ’cp -r’, PowerShell Remove-Item, Move-Item o Copy-Item puede entonces interpretar el nombre de archivo como sintaxis de shell. Esto permite la ejecución arbitraria de comandos con los privilegios del usuario de escritorio de electerm en sistemas POSIX y Windows, lo que posibilita la exfiltración de datos, la modificación de archivos, la instalación de malware o la denegación de servicio. Este problema se ha solucionado en la versión 3.11.11.","source":"nvd"}],"published":"2026-07-02T19:22:31.000Z","modified":"2026-10-27T13:10:00.360Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 3.11.11","status":"affected"}],"vendor":"electerm","product":"electerm","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.11.11"}],"ecosystem":"npm","package":"electerm","purl":"pkg:npm/electerm","source":"ghsa"}],"references":[{"url":"https://github.com/electerm/electerm/security/advisories/GHSA-v5ff-xmfp-p245","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/electerm/electerm/commit/aa778818843b9c083bd711cd04644d102fcb5a42","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/electerm/electerm/releases/tag/v3.11.11","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/electerm/electerm","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-08-25T02:03:51.502Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49255","url":"https://www.cve.org/CVERecord?id=CVE-2026-49255","licence":"CVE Terms of Use","modified":"2026-08-25T02:04:00.692Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v5ff-xmfp-p245","url":"https://github.com/advisories/GHSA-v5ff-xmfp-p245","licence":"CC-BY-4.0","modified":"2026-07-02T19:41:33.135Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49255","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49255","licence":"Public domain","modified":"2026-10-27T13:10:00.360Z"}],"updatedAt":"2026-11-25T22:59:33.957Z","epss":{"score":0.00527,"percentile":0.46057,"date":"2026-12-01T12:00:22.000Z"}}