{"id":"CVE-2026-43940","aliases":["CVE-2026-43940","GHSA-f77v-9vpc-6pjm"],"related":[],"kind":"vulnerability","state":"published","title":"electerm: Path traversal in electerm runWidget leads to arbitrary code execution","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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).","format":"markdown","source":"ghsa"},{"lang":"es","text":"electerm es un cliente de terminal/ssh/sftp/telnet/puerto serie/RDP/VNC/Spice/ftp de código abierto. Antes de la versión 3.7.16, la función runWidget en src/app/widgets/load-widget.js construye una ruta de archivo concatenando directamente identificadores de widget proporcionados por el usuario sin ninguna sanitización. Debido a que runWidget está expuesto al proceso de renderizado a través de un gestor IPC asíncrono sin validación de entrada, un atacante que logra la ejecución de JavaScript dentro del renderizador (por ejemplo, a través de un plugin malicioso o una falla de cross-site scripting en el webview incorporado) puede abusar de un salto de ruta (.. / ) para cargar y ejecutar un archivo JavaScript arbitrario en cualquier lugar del sistema de archivos de la víctima. Esto le da al atacante ejecución de código local con los privilegios completos del proceso electerm, lo que lleva a un compromiso completo del sistema. Este problema ha sido parcheado en la versión 3.7.16.","source":"nvd"}],"published":"2026-05-08T02:58:05.646Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-22","CWE-829"],"affected":[{"ranges":[{"version":"< 3.7.16","status":"affected"}],"vendor":"electerm","product":"electerm","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.7.16"}],"ecosystem":"npm","package":"electerm","purl":"pkg:npm/electerm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.7.16"}],"vendor":"electerm_project","product":"electerm","cpe":"cpe:2.3:a:electerm_project:electerm:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/electerm/electerm/security/advisories/GHSA-f77v-9vpc-6pjm","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/electerm/electerm/releases/tag/v3.7.16","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43940","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/electerm/electerm","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-05-08T12:52:37.558Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43940","url":"https://www.cve.org/CVERecord?id=CVE-2026-43940","licence":"CVE Terms of Use","modified":"2026-05-08T12:52:47.567Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f77v-9vpc-6pjm","url":"https://github.com/advisories/GHSA-f77v-9vpc-6pjm","licence":"CC-BY-4.0","modified":"2026-05-08T18:56:26.083Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43940","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43940","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:20.953Z","epss":{"score":0.00167,"percentile":0.06233,"date":"2026-12-01T12:00:22.000Z"}}