CVE-2026-49255: Electerm Electerm Has Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-v5ff-xmfp-p245
CVSS 8.8
CWE-78
Published
Advisory Summary

CVE-2026-49255 is a HIGH (CVSS 8.8) electerm has command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Electerm libraries in the npm ecosystem. The issue involves electerm has command injection in file system operations (rmrf, mv, cp). Remediation is available by upgrading affected packages to version 3.11.11.

CVE-2026-49255 at a Glance

CVE Identifier CVE-2026-49255
GHSA Identifier GHSA-v5ff-xmfp-p245
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Electerm
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-49255

To remediate this vulnerability, upgrade all affected Electerm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

electerm fixed: 3.11.11
npm install electerm@3.11.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls electerm

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-49255, inspect your project dependencies using npm:

npm ls electerm

Analyze the terminal output to locate any version of Electerm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.11.11), your application is affected.

Note: The npm ls electerm command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Electerm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact 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 ### Patches - https://github.com/electerm/electerm/commit/aa778818843b9c083bd711cd04644d102fcb5a42 ### Workarounds If upgrading is not immediately possible, users can mitigate this vulnerability by: 1. Only connecting to trusted SSH/SFTP servers 2. Avoiding remote-to-local file transfers from untrusted sources 3. Not using the "rename on conflict" option when downloading folders from untrusted servers 4. Manually verifying filenames before performing file operations

CVE-2026-49255 Affected Electerm Versions

1 component(s)
Fixed Versions:
3.11.11
Product / Package Ecosystem Affected Versions Fixed Version
electerm
npm
< 3.11.11
3.11.11

References

Frequently Asked Questions

What is CVE-2026-49255?
CVE-2026-49255 is a security vulnerability in Electerm involving electerm has Command Injection in File System Operations (rmrf, mv, cp) under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Electerm versions are affected?
Affected versions include releases prior to 3.11.11 across affected packages: electerm.
What version fixes CVE-2026-49255?
Upgrading to 3.11.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electerm affected?
Yes, electerm is affected in releases prior to 3.11.11. Upgrade your dependency to 3.11.11 or later.
What is the CVSS score of CVE-2026-49255?
CVE-2026-49255 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-49255?
CVE-2026-49255 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-49255?
Run the dependency tree command: 'npm ls electerm'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v5ff-xmfp-p245",
  "modified" : "2026-07-02T19:22:31Z",
  "published" : "2026-07-02T19:22:31Z",
  "aliases" : [ "CVE-2026-49255" ],
  "summary" : "electerm has Command Injection in File System Operations (rmrf, mv, cp)",
  "details" : "### 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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electerm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.11.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.11.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/electerm/electerm/security/advisories/GHSA-v5ff-xmfp-p245"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electerm/electerm/commit/aa778818843b9c083bd711cd04644d102fcb5a42"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/electerm/electerm"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T19:22:31Z",
    "nvd_published_at" : null
  }
}