GHSA-38J7-23HF-9MHC
Vulnerability from github – Published: 2026-07-02 19:20 – Updated: 2026-07-02 19:20Impact
A path traversal vulnerability exists in the Zmodem and Trzsz file download handlers in electerm. When receiving files via Zmodem or Trzsz protocols, electerm uses the remote-supplied filename directly in path.join() with the user-selected download directory without sanitization.
A malicious SSH server or remote shell process can send a specially crafted filename such as ../escaped.txt to escape the user-selected download directory and write files to arbitrary locations on the user's filesystem, subject to process permissions.
Attack scenario:
1. User connects to a malicious SSH server
2. Attacker initiates a Zmodem or Trzsz file transfer
3. Attacker supplies a traversal filename (e.g., ../../.bashrc, ../escaped.txt)
4. User accepts the transfer and selects a download directory
5. File is written outside the selected directory, potentially overwriting sensitive files
Affected components:
- src/app/server/zmodem.js - prepareReceiveFile() at line 736
- src/app/server/trzsz.js - getUniqueFilePath() at line 559, openSaveFile() callback, and savedFilePaths mapping
Patches
- https://github.com/electerm/electerm/commit/fde153d677a170c5816368f6586647f3af4ef284
Workarounds
If upgrading is not immediately possible, users can mitigate this vulnerability by:
1. Only connecting to trusted SSH servers
2. Rejecting or canceling any incoming Zmodem or Trzsz file transfers from untrusted sources
3. Avoiding the use of Zmodem (sz/rz) and Trzsz (trz/tsz) commands on untrusted servers
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.11.0"
},
"package": {
"ecosystem": "npm",
"name": "electerm"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.11.11"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-49253"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-02T19:20:20Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Impact\n\nA path traversal vulnerability exists in the Zmodem and Trzsz file download handlers in electerm. When receiving files via Zmodem or Trzsz protocols, electerm uses the remote-supplied filename directly in `path.join()` with the user-selected download directory without sanitization.\n\nA malicious SSH server or remote shell process can send a specially crafted filename such as `../escaped.txt` to escape the user-selected download directory and write files to arbitrary locations on the user\u0027s filesystem, subject to process permissions.\n\n**Attack scenario:**\n1. User connects to a malicious SSH server\n2. Attacker initiates a Zmodem or Trzsz file transfer\n3. Attacker supplies a traversal filename (e.g., `../../.bashrc`, `../escaped.txt`)\n4. User accepts the transfer and selects a download directory\n5. File is written outside the selected directory, potentially overwriting sensitive files\n\n**Affected components:**\n- `src/app/server/zmodem.js` - `prepareReceiveFile()` at line 736\n- `src/app/server/trzsz.js` - `getUniqueFilePath()` at line 559, `openSaveFile()` callback, and `savedFilePaths` mapping\n\n### Patches\n\n- https://github.com/electerm/electerm/commit/fde153d677a170c5816368f6586647f3af4ef284\n\n### Workarounds\n\n\nIf upgrading is not immediately possible, users can mitigate this vulnerability by:\n1. Only connecting to trusted SSH servers\n2. Rejecting or canceling any incoming Zmodem or Trzsz file transfers from untrusted sources\n3. Avoiding the use of Zmodem (`sz`/`rz`) and Trzsz (`trz`/`tsz`) commands on untrusted servers",
"id": "GHSA-38j7-23hf-9mhc",
"modified": "2026-07-02T19:20:20Z",
"published": "2026-07-02T19:20:20Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/electerm/electerm/security/advisories/GHSA-38j7-23hf-9mhc"
},
{
"type": "WEB",
"url": "https://github.com/electerm/electerm/commit/fde153d677a170c5816368f6586647f3af4ef284"
},
{
"type": "PACKAGE",
"url": "https://github.com/electerm/electerm"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "electerm has Path Traversal in Zmodem and Trzsz Download Filename Handling"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.