/

CVE-2026-43944

Severity:

CRITICAL RISK

(9.6)

Code Injection / Unsafe Input Handling in Electerm Deep

CVE-2026-43944

Modified

Vulnerability type

Category:

Code Injection / Unsafe Input Handling

CWE:

CWE-20, CWE-94, CWE-829

Impact:

Arbitrary Local Code Execution

Severity:

CRITICAL RISK

(9.6)

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 versions 3.0.6 to before 3.8.15 contain a flaw in how they process command-line options and deep-link parameters, enabling arbitrary local code execution.

If a user is tricked into clicking a crafted electerm:// URL or opening a malicious shortcut/command that launches Electerm with attacker-controlled options, the attacker's commands may run on the victim's machine.

Affected context

The vulnerability arises in desktop environments where Electerm is installed and registered as a handler for electerm:// deep links or is commonly launched via shortcuts or command-line invocations.

It becomes relevant when:

  • The application accepts CLI --opts or deep-link parameters that influence how sessions, commands, or scripts are executed
  • Input from URLs, shortcuts, or shell commands is not sufficiently validated or constrained before being used in execution contexts
  • Users can be socially engineered into activating crafted links or opening untrusted shortcut files

Exploit preconditions

  • Attack surface: Local desktop environment where Electerm is installed (e.g., via browser deep links, OS-level URI handlers, desktop shortcuts, or shell commands).
  • Required access: Ability to deliver or control the electerm:// link, shortcut, or command invocation that the victim will execute (e.g., via email, chat, web page, or shared file).
  • User interaction: User must click the crafted deep link or open/run the crafted shortcut/command that launches Electerm with attacker-specified options.
  • Trigger point: Application startup or option parsing, where Electerm interprets --opts or deep-link parameters and maps them to actions such as running commands or scripts.
  • Why exploitation is possible: Untrusted option values are treated as trusted instructions, allowing attacker-controlled data to be injected into execution paths without adequate validation, whitelisting, or context separation.

Why this happens

This issue stems from Electerm's option and deep-link handling logic treating externally supplied parameters as trusted configuration and, in some cases, as executable instructions.

Parameters from electerm:// URLs, CLI --opts, or shortcuts appear to be passed into code paths that can start sessions, run commands, or invoke scripts with insufficient sanitization or restriction.

Conceptually, this maps to:

  • CWE-94: Improper Control of Generation of Code ('Code Injection') where untrusted data can influence what is executed.
  • Contributing factors from CWE-20: Improper Input Validation, since there is no strong validation or whitelisting of allowed options/values.
  • A related angle of CWE-829: Inclusion of Functionality from Untrusted Control Sphere, as external, attacker-controlled launch contexts (links/shortcuts) can steer Electerm into executing unintended functionality.

The insecure pattern is allowing configuration-like inputs that originate outside the application's trust boundary (links, shortcuts, CLI) to directly drive executable behavior.

Potential impact

  • Execution of arbitrary commands under the privileges of the current desktop user
  • Installation of malware or backdoors on the victim's system
  • Access to sensitive SSH keys, session data, or files accessible to that user
  • Lateral movement to remote systems reachable via Electerm sessions (SSH, RDP, VNC, etc.)
  • Integrity and confidentiality compromise of local and remote environments used through Electerm

General mitigation guidance

Effective mitigation focuses on reducing the trust placed in deep-link and CLI inputs and breaking the path from user-controlled options to code execution:

  • Constrain option semantics: Treat CLI and deep-link parameters as declarative configuration only, never as direct command strings or script bodies.
  • Strong input validation: Apply strict whitelisting of allowed options and value formats; reject or ignore unknown or malformed options rather than attempting to interpret them.
  • Execution separation: Route any behavior that may execute commands or scripts through hardened, parameterized APIs instead of composing shell commands or dynamically evaluating code.
  • Context-aware parsing: Ensure electerm:// handlers and --opts parsing clearly distinguish between data and executable behavior, and avoid interpolating user-supplied values into execution contexts.
  • Least privilege by design: Where possible, minimize the privileges under which Electerm runs and limit its ability to spawn privileged or system-wide processes.
  • Safe default behavior: When launched with ambiguous or unexpected options, default to a safe, non-executing mode (e.g., show a prompt or ignore suspicious parameters).

How teams detect issues like this

Detection can be approached through both code-level and behavior-level analysis:

  • Static analysis: Search for code paths where deep-link parameters, CLI --opts, or shortcut-provided arguments are used in constructing commands, invoking shell APIs, or feeding directly into evaluation functions.
  • Code review signals:
  • Parsing of electerm:// URLs or command-line arguments followed by calls to process spawning, shell execution, or dynamic code evaluation.
  • Lack of strict validation or whitelisting around parameters that control what commands execute or which scripts load.
  • Any logic that concatenates user-controlled input into command strings or script paths.
  • Policy enforcement: Define secure coding guidelines that forbid direct execution from deep-link or CLI input and enforce them in pull requests (e.g., via pre-commit hooks or CI checks).
  • Runtime monitoring: On enterprise endpoints, use EDR or application control solutions to flag unusual process trees originating from Electerm, such as shells, script interpreters, or administrative tools spawned with unexpected arguments.

Sources

SourceLink
github.comgithub.com/electerm/electerm/commit/0599e67069b00e376a2e962649aaad6096e63507
github.comgithub.com/electerm/electerm/commit/8a6a17951e96d715f5a231532bbd8303fe208700
github.comgithub.com/electerm/electerm/commit/a79e06f4a1f0ac6376c3d2411ef4690fa0377742
github.comgithub.com/electerm/electerm/releases/tag/v3.8.15
github.comgithub.com/electerm/electerm/security/advisories/GHSA-mpm8-cx2p-626q

Frequently asked

questions

It is typically exploitable through remote delivery of a malicious electerm:// link (for example, via a web page, email, or chat) that the victim then activates locally. The actual code execution occurs on the victim's machine, triggered by local handling of that link or shortcut.

The attacker does not need prior access to the victim's system but must be able to convince the user to open a crafted deep link, shortcut, or command that launches Electerm with attacker-controlled options. The resulting code runs with the privileges of the user who opened it.

The robust fix is to ensure that CLI --opts and deep-link parameters are treated as data only, are strictly validated against a whitelist of allowed values, and can no longer directly specify commands or scripts to run. Any functionality that executes commands should be decoupled from untrusted launch parameters and routed through controlled, parameterized APIs.

When adding or extending deep-link and command-line capabilities, define clear trust boundaries, validate all external input rigorously, and avoid any pattern where user-controlled values influence code generation or command construction. Incorporate security reviews and automated checks focused on URI handlers, shortcut parsing, and option handling into the development lifecycle.

Find out what's already
exploitable in your codebase.