/

CVE-2026-73223

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in electerm SFTP Component

CVE-2026-73223

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write

Severity:

HIGH RISK

(8.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

A path traversal vulnerability in electerm allows a malicious SFTP server to control a filename used when opening a file with the system editor. If a user connects to an untrusted SFTP server and invokes the affected editing workflow, attacker-controlled paths may cause content to be written outside the intended temporary directory.

Affected context

The issue occurs in electerm's SFTP file-editing workflow, specifically when a server-provided filename is passed to path resolution without sufficient sanitization. It is relevant when a user connects to a malicious or compromised SFTP server and uses the system-editor feature on a remotely referenced file.

Exploit preconditions

  • Attack surface: SFTP client file-editing functionality
  • Required access: A user must connect electerm to an attacker-controlled or compromised SFTP server
  • Trigger point: The user invokes the system editor for an SFTP file
  • Why exploitation is possible: Server-controlled filename data is interpolated into path resolution without enforcing confinement to the intended temporary directory

Why this happens

The vulnerability results from treating a server-controlled filename as a trusted filesystem path. When that value is incorporated into path.resolve without canonicalization and boundary validation, traversal components or other path manipulations can escape the intended directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • Attacker-controlled content may be written outside the temporary directory
  • Sensitive local files may be overwritten or corrupted
  • Application or user configuration may be modified
  • Arbitrary file writes could contribute to code execution depending on the target path and operating-system controls
  • Local data integrity and confidentiality may be affected

General mitigation guidance

Mitigation generally focuses on treating all remote filenames as untrusted and enforcing a strict directory boundary.

Common defensive patterns include:

  • Resolve paths against a fixed trusted base directory, then verify the canonical result remains within that directory
  • Reject absolute paths, traversal segments, symbolic-link escapes, and platform-specific alternate path forms
  • Generate local temporary filenames instead of reusing server-provided names
  • Separate remote metadata from local filesystem paths
  • Apply least-privilege permissions to the client process and temporary-directory contents
  • Avoid opening or writing files in security-sensitive locations based solely on remote input

How teams detect issues like this

Organizations can look for:

  • Static analysis findings where remote filenames flow into path.join, path.resolve, filesystem writes, or editor-launch routines
  • Code review signals involving missing canonicalization, directory-boundary checks, or rejection of absolute and traversal paths
  • Tests that use traversal sequences, absolute paths, symbolic links, and platform-specific path formats
  • Runtime policy controls that restrict write operations to approved temporary directories

Automated code review and SAST tools may help identify untrusted path data reaching filesystem APIs, but findings should be validated against actual path-confinement logic.

Sources

SourceLink
github.comgithub.com/electerm/electerm/commit/32ea29365762b3451b1f2fcc0ef78104384db282
github.comgithub.com/electerm/electerm/releases/tag/v3.15.120
github.comgithub.com/electerm/electerm/security/advisories/GHSA-4cgc-4vgf-q55c

Frequently asked

questions

It can be triggered through a malicious SFTP server, but exploitation generally requires a user to connect to that server and use the affected system-editor workflow.

No direct local access is necessarily required. The attacker needs control of, or influence over, the SFTP server and must induce a client-side file-editing action.

Treat server-provided names as untrusted data, generate local temporary names where possible, and verify that every canonicalized path remains inside an approved directory before writing.

Use centralized path-confinement helpers, test cross-platform path edge cases, restrict client privileges, and review every flow where remote metadata reaches local filesystem APIs.

Find out what's already
exploitable in your codebase.