{"id":"CVE-2026-43940","aliases":["GHSA-f77v-9vpc-6pjm"],"url":"https://o3.security/vulnerability/CVE-2026-43940","summary":"electerm: Path traversal in electerm runWidget leads to arbitrary code execution","details":"### Impact\nThe `runWidget` function in `src/app/widgets/load-widget.js` constructs a file path by directly concatenating user‑supplied widget identifiers without any sanitisation:\n\n```javascript\nconst file = `widget-${widgetId}.js`\nconst widget = require(path.join(__dirname, file))\n```\n\nBecause `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.\n\n### Patches\n\nFixed in version >= 3.7.16\n\n### Workarounds\nUntil a patch is released:\n- Do not install or run untrusted plugins.\n- Avoid loading arbitrary web content inside electerm’s embedded webview (for example, disable any features that fetch and display remote HTML).\n- Run electerm in a sandboxed environment (e.g., with `bubblewrap` on Linux, AppArmor/SELinux profiles, or Windows sandboxed app execution) to limit the impact of any code execution.\n\n### Resources\n- [electerm GitHub Repository](https://github.com/electerm/electerm)\n- [electerm Security Policy](https://github.com/electerm/electerm/security)\n- Vulnerability details originally reported by external researcher (PoC confirmed on v3.7.9, Win10).","published":"2026-05-08T02:58:05.646Z","modified":"2026-08-12T03:51:30.845015115Z","cvss":{"score":8.4,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},"epss":{"score":0.00167,"percentile":0.06096,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"electerm","fixedVersion":"3.7.16"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/electerm/electerm/releases/tag/v3.7.16"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/43xxx/CVE-2026-43940.json"},{"type":"ADVISORY","url":"https://github.com/electerm/electerm/security/advisories/GHSA-f77v-9vpc-6pjm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43940"},{"type":"PACKAGE","url":"https://github.com/electerm/electerm"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:30.845015115Z"}}