CVE-2026-43940: Electerm runWidget path traversal leading to code execution

CVE-2026-43940 · Severity: high · CVSS 8.4 · Published 2026-05-08

Electerm is a terminal/SSH client application. The runWidget feature allows loading JavaScript widget modules, but fails to properly validate file paths. An attacker who gains JavaScript execution within the application (via malicious plugins or web content) can bypass path restrictions to load and execute arbitrary code files from the system, achieving full system compromise with the privileges of the electerm process.

Technologies: Electerm Project Electerm, electerm (npm). Vendors: Electerm Project, npm.

Quick answers

Is CVE-2026-43940 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-43940 being exploited in the wild.
How severe is CVE-2026-43940?
High severity, with a CVSS score of 8.4, published 8 May 2026.
Which products and versions are affected?
electerm (npm) SEMVER:introduced=0,fixed=3.7.16.
Is there a fix for CVE-2026-43940?
Yes. electerm (npm): upgrade to 3.7.16 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-43940 attacked?
It is attacked with local access.
Am I affected by CVE-2026-43940?
Check whether you run Electerm Project Electerm or electerm (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • electerm (npm): upgrade to 3.7.16 or later
    npm install electerm@3.7.16

Technical details

The vulnerability is a path traversal flaw in the runWidget function (src/app/widgets/load-widget.js) that constructs file paths by concatenating unsanitized user-supplied widget identifiers without validation. The vulnerable code uses `require(path.join(__dirname, file))` where the file path is built from a user-controlled widgetId parameter. Because runWidget is exposed to the renderer process via an asynchronous IPC handler without input validation, an attacker with JavaScript execution access in the renderer process (achievable through malicious plugins or XSS in the built-in webview) can inject path traversal sequences like `../` to load and execute arbitrary JavaScript files anywhere on the filesystem. This results in local code execution with full electerm process privileges. The vulnerability was fixed in version 3.7.16 and is tracked as CVE-2026-43940.

Affected products

  • Electerm Electerm <3.7.16

Identifiers

  • CVE-2026-43940
  • GHSA-f77v-9vpc-6pjm

Timeline

  • 2026-05-08: disclosed
  • 2026-05-08: patched: Fixed in version 3.7.16

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.