/

CVE-2026-49253

Severity:

HIGH RISK

(7.1)

Path Traversal (CWE-22) in electerm Transfer Files

CVE-2026-49253

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Overwrite

Severity:

HIGH RISK

(7.1)

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 uses filenames supplied by remote systems when saving Zmodem and Trzsz transfers, allowing path traversal components to escape the directory selected by the user. A malicious SSH server or remote shell could cause files accessible to the desktop user to be overwritten when the victim accepts a transfer.

Affected context

The vulnerability occurs in electerm file-transfer workflows that receive filenames from remote systems and combine them with a user-selected download directory. It is relevant when a victim connects to an untrusted or compromised remote endpoint, accepts a Zmodem or Trzsz transfer, and the client does not constrain the resulting destination to the selected directory.

Exploit preconditions

  • Attack surface: Zmodem or Trzsz file-transfer handling in the desktop client
  • Required access: A remote SSH server or shell capable of supplying transfer filenames
  • Victim interaction: The victim must accept the transfer and select a local save directory
  • Trigger point: Destination-path construction during receipt of the transferred file
  • Why exploitation is possible: Remote-supplied filenames are joined with the selected path without sufficient traversal sanitization or containment checks

Why this happens

The underlying bug is a failure to treat remote-supplied filenames as untrusted path components. Passing such names directly to path-joining logic allows traversal elements to influence the final destination instead of restricting it to the intended save directory. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • Files outside the selected download directory may be overwritten
  • Sensitive user configuration or application data could be modified
  • Desktop-user files may be corrupted or deleted depending on transfer behavior
  • Application availability could be impaired
  • Modified configuration files could enable follow-on compromise

General mitigation guidance

Mitigation typically focuses on enforcing a trusted destination boundary for every received filename.

Common defensive patterns include:

  • Treating all remote-provided filenames as untrusted input
  • Normalizing candidate paths and verifying they remain within the selected base directory
  • Rejecting absolute paths, traversal components, and unsafe platform-specific path forms
  • Generating safe local filenames rather than preserving unrestricted remote names
  • Applying overwrite confirmation and limiting the client's file-system permissions
  • Using a dedicated, least-privileged download location where practical

These controls reduce the impact of malicious transfer metadata even when users accept files from untrusted endpoints.

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis rules for path joins involving network- or user-controlled filenames
  • Code review checks for missing canonicalization and destination-containment validation
  • Tests covering relative traversal, absolute paths, alternate separators, and encoded path forms
  • Policy enforcement requiring file writes to remain within approved directories
  • Runtime telemetry for transfer operations that attempt writes outside configured download roots

Automated security review tools may help identify suspicious path-construction patterns, but behavioral tests are useful for validating platform-specific path handling.

Sources

SourceLink
github.comgithub.com/electerm/electerm/commit/fde153d677a170c5816368f6586647f3af4ef284
github.comgithub.com/electerm/electerm/releases/tag/v3.11.11
github.comgithub.com/electerm/electerm/security/advisories/GHSA-38j7-23hf-9mhc

Frequently asked

questions

It can be triggered by a malicious or compromised remote server, but exploitation generally requires the victim to connect to that endpoint and accept a file transfer.

The attacker needs control of, or the ability to influence, a remote system involved in a Zmodem or Trzsz transfer. They do not necessarily need local access to the victim's file system.

Treat received filenames as untrusted, normalize them, reject unsafe forms, and verify that the final path remains within the user-selected destination directory before writing.

Combine path-containment checks with least-privilege execution, safe filename generation, overwrite protections, and automated tests for traversal variants across supported platforms.

Find out what's already
exploitable in your codebase.