/

CVE-2026-49255

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in electerm File Ops

CVE-2026-49255

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

electerm contains an OS command injection vulnerability when untrusted filenames from remote SSH or SFTP servers are interpolated into file-management commands. If a victim transfers, copies, moves, renames, or removes a file with a crafted name, the filename may be interpreted as shell syntax and execute commands with the desktop user's privileges.

Affected context

The vulnerability occurs in electerm's file-management functions when remote filenames are incorporated into commands for recursive removal, moving, or copying. It can affect POSIX and Windows environments when a malicious SSH or SFTP server supplies a filename containing shell-significant characters and the victim performs an operation that processes that filename.

Exploit preconditions

  • Attack surface: Remote-to-local SSH or SFTP file-transfer and file-management workflows
  • Required access: A connection to, or interaction with, a malicious or compromised remote server, plus the victim's ability to initiate or accept the relevant file operation
  • Trigger point: Processing a remote filename during transfer, conflict renaming, copying, moving, or removal
  • Why exploitation is possible: The filename is inserted into an operating system command without reliably separating data from command syntax

Why this happens

The underlying bug is unsafe construction of operating system commands through string interpolation of untrusted file paths. When filenames are concatenated into shell commands or platform command strings, quote characters and metacharacters can change the command's interpretation rather than remain ordinary data. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because attacker-controlled input reaches a command interpreter without adequate separation or neutralization.

Potential impact

  • Arbitrary commands may execute with the electerm desktop user's privileges
  • Local files could be modified, copied, moved, or deleted
  • Sensitive information could be exfiltrated
  • Malware could be installed or additional persistence could be established
  • The workstation could experience denial of service or broader compromise

General mitigation guidance

Mitigation generally focuses on preventing untrusted filenames from becoming command syntax.

Common defensive patterns include:

  • Prefer direct filesystem APIs and argument-array process interfaces over shell command construction
  • Avoid invoking command interpreters for routine copy, move, and removal operations
  • Apply platform-appropriate path handling while treating remote filenames as untrusted data
  • Enforce strict validation and canonicalization rules without relying on filtering alone
  • Run the desktop application with least privilege and limit access to sensitive files
  • Use sandboxing or capability restrictions where practical to reduce the effect of command execution
  • Maintain clear trust boundaries between remote server metadata and local filesystem operations

How teams detect issues like this

Detection can focus on code paths that construct shell or platform commands from filenames or paths.

Useful approaches include:

  • Static analysis for string interpolation, concatenation, or formatting passed to shell execution APIs
  • Code review checks for file paths originating from SSH, SFTP, or other remote sources
  • Searches for command templates used with removal, copy, move, or recursive filesystem operations
  • Testing with filenames containing quoting and shell-significant characters in isolated environments
  • Policy enforcement requiring direct filesystem APIs or safely separated process arguments
  • Runtime monitoring for unexpected child processes spawned by the desktop client

Automated code review and software composition analysis tools may help identify related command-construction patterns.

Sources

SourceLink
github.comgithub.com/electerm/electerm/commit/aa778818843b9c083bd711cd04644d102fcb5a42
github.comgithub.com/electerm/electerm/releases/tag/v3.11.11
github.comgithub.com/electerm/electerm/security/advisories/GHSA-v5ff-xmfp-p245

Frequently asked

questions

Yes. A malicious server may be able to provide a specially formed filename, and exploitation can occur when the client processes that filename during an affected local file operation.

The attacker generally needs to control or compromise a server with which the victim connects, while the victim must perform or trigger a relevant transfer or file-management action.

Use direct filesystem operations or process APIs that pass paths as distinct arguments, avoiding shell interpretation and treating all remote filenames as untrusted data.

Apply secure command-construction policies, review remote-input data flows, test filename edge cases, enforce least privilege, and monitor unexpected child-process activity.

Find out what's already
exploitable in your codebase.