Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. electerm
  4. ›
  5. CVE-2026-49255

CVE-2026-49255: electerm has Command Injection in File System Operations (rmrf, mv, cp)

July 2, 2026

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

References

  • github.com/advisories/GHSA-v5ff-xmfp-p245
  • github.com/electerm/electerm/commit/aa778818843b9c083bd711cd04644d102fcb5a42
  • github.com/electerm/electerm/security/advisories/GHSA-v5ff-xmfp-p245
  • nvd.nist.gov/vuln/detail/CVE-2026-49255

Code Behaviors & Features

Detect and mitigate CVE-2026-49255 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.11.11

Fixed versions

  • 3.11.11

Solution

Upgrade to version 3.11.11 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Source file

npm/electerm/CVE-2026-49255.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Mon, 13 Jul 2026 00:21:17 +0000.