CVE-2023-39956
JSON

6.1medium

Electron: Out-of-package code execution when launched with arbitrary cwd

Severity
6.1medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.49% (higher than 43% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-7x97-j373-85x5

Description

Electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS. Electron apps that are launched as command line executables are impacted. Specifically this issue can only be exploited if the following conditions are met: 1. The app is launched with an attacker-controlled working directory and 2. The attacker has the ability to write files to that working directory. This makes the risk quite low, in fact normally issues of this kind are considered outside of our threat model as similar to Chromium we exclude Physically Local Attacks but given the ability for this issue to bypass certain protections like ASAR Integrity it is being treated with higher importance. This issue has been fixed in versions:`26.0.0-beta.13`, `25.4.1`, `24.7.1`, `23.3.13`, and `22.3.19`. There are no app side workarounds, users must update to a patched version of Electron.

Affected

Product or packageVersionsReported by
electron electron< 22.3.19, >= 23.0.0, < 23.3.13, >= 24.0.0, < 24.7.1, >= 25.0.0, < 25.4.1, >= 26.0.0-beta.1, < 26.0.0-beta.13CVE List
electron (npm)before 22.3.19, from 23.0.0-alpha.1 before 23.3.13, from 24.0.0-alpha.1 before 24.7.1, from 25.0.0-alpha.1 before 25.5.0, from 26.0.0-alpha.1 before 26.0.0-beta.13GitHub Advisory Database
electronjs electronbefore 22.3.9, from 23.0.0 before 23.3.13, from 24.0.0 before 24.7.1, from 25.0.0 before 25.5.0, 26.0.0NVD

All scores

GitHub_M6.1medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:L
GitHub6.1medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:L
NVD6.6medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L

Classification

CWE-94

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS. Electron apps that are launched as command line executables are impacted. Specifically this issue can only be exploited if the following conditions are met: 1. The app is launched with an attacker-controlled working directory and 2. The attacker has the ability to write files to that working directory. This makes the risk quite low, in fact normally issues of this kind are considered outside of our threat model as similar to Chromium we exclude Physically Local Attacks but given the ability for this issue to bypass certain protections like ASAR Integrity it is being treated with higher importance. This issue has been fixed in versions:`26.0.0-beta.13`, `25.4.1`, `24.7.1`, `23.3.13`, and `22.3.19`. There are no app side workarounds, users must update to a patched version of Electron.

GitHub Advisory Database
Impact

Apps that are launched as command line executables are impacted. E.g. if your app exposes itself in the path as myapp --help

Specifically this issue can only be exploited if the following conditions are met:

  • Your app is launched with an attacker-controlled working directory
  • The attacker has the ability to write files to that working directory

This makes the risk quite low, in fact normally issues of this kind are considered outside of our threat model as similar to Chromium we exclude Physically Local Attacks but given the ability for this issue to bypass certain protections like ASAR Integrity it is being treated with higher importance. Please bear this in mind when reporting similar issues in the future.

Workarounds

There are no app side workarounds, you must update to a patched version of Electron.

Fixed Versions
  • 26.0.0-beta.13
  • 25.5.0
  • 24.7.1
  • 23.3.13
  • 22.3.19
For more information

If you have any questions or comments about this advisory, email us at security@electronjs.org

NVD (es)

"Electron es un framework que le permite escribir aplicaciones de escritorio multiplataforma utilizando JavaScript, HTML y CSS. Las aplicaciones de Electron que se inician como ejecutables de línea de comandos se ven afectadas. Específicamente, este problema solo puede explotarse si se cumplen las siguientes condiciones: 1. La aplicación se inicia con un directorio de trabajo controlado por el atacante y 2. El atacante tiene la capacidad de escribir archivos en ese directorio de trabajo. Esto hace que el riesgo sea bastante bajo, de hecho, normalmente los problemas de este tipo se consideran fuera de nuestro modelo de amenaza, ya que son similares a Chromium y excluimos los ataques físicamente locales, pero dada la capacidad de este problema para eludir ciertas protecciones como la Integridad ASAR, se está tratando con niveles más altos de importancia. Este problema se solucionó en las versiones: `26.0.0-beta.13`, `25.4.1`, `24.7.1`, `23.3.13` y `22.3.19`. No existen workarounds en la aplicación, los usuarios deben actualizar a una versión parcheada de Electron."

References

Sources

SourceRecordLicence
CVE ListCVE-2023-39956 changed 2024-09-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-7x97-j373-85x5 changed 2026-09-10CC-BY-4.0
NVDCVE-2023-39956 changed 2026-06-17Public domain