CVE-2023-29198
JSON

6.0medium

Context isolation bypass via nested unserializable return value in Electron

Severity
6.0medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.59% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-p7v2-p9m8-qqg7

Description

Electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS. Electron apps using `contextIsolation` and `contextBridge` are affected. This is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions. This issue is only exploitable if an API exposed to the main world via `contextBridge` can return an object or array that contains a javascript object which cannot be serialized, for instance, a canvas rendering context. This would normally result in an exception being thrown `Error: object could not be cloned`. The app side workaround is to ensure that such a case is not possible. Ensure all values returned from a function exposed over the context bridge are supported. This issue has been fixed in versions `25.0.0-alpha.2`, `24.0.1`, `23.2.3`, and `22.3.6`.

Affected

Product or packageVersionsReported by
electron electron< 22.3.6, >= 23.0.0, < 23.2.3, >= 24.0.0, < 24.0.1, >= 25.0.0-alpha.1, < 25.0.0-alpha.2CVE List
electron (npm)before 22.3.6, from 23.0.0-alpha.1 before 23.2.3, from 24.0.0-alpha.1 before 24.0.1, from 25.0.0-alpha.1 before 25.0.0-alpha.2GitHub Advisory Database
electronjs electronbefore 22.3.6, from 23.0.0 before 23.2.3, 24.0.0, 25.0.0NVD

All scores

GitHub_M6.0medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L
GitHub6.0medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L
NVD8.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-754

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 using `contextIsolation` and `contextBridge` are affected. This is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions. This issue is only exploitable if an API exposed to the main world via `contextBridge` can return an object or array that contains a javascript object which cannot be serialized, for instance, a canvas rendering context. This would normally result in an exception being thrown `Error: object could not be cloned`. The app side workaround is to ensure that such a case is not possible. Ensure all values returned from a function exposed over the context bridge are supported. This issue has been fixed in versions `25.0.0-alpha.2`, `24.0.1`, `23.2.3`, and `22.3.6`.

GitHub Advisory Database
Impact

Apps using contextIsolation and contextBridge are affected.

This is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions.

Workarounds

This issue is exploitable under either of two conditions:

  • If an API exposed to the main world via contextBridge can return an object or array that contains a JS object which cannot be serialized, for instance, a canvas rendering context. This would normally result in an exception being thrown Error: object could not be cloned.
  • If an API exposed to the main world via contextBridge has a return value that throws a user-generated exception while being sent over the bridge, for instance a dynamic getter property on an object that throws an error when being computed.

The app side workaround is to ensure that such a case is not possible. Ensure all values returned from a function exposed over the context bridge are supported and that any objects returned from functions do not have dynamic getters that can throw exceptions.

Auditing your exposed API is likely to be quite difficult so we strongly recommend you update to a patched version of Electron.

Fixed Versions
  • 25.0.0-alpha.2
  • 24.0.1
  • 23.2.3
  • 22.3.6
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 usan `contextIsolation` y `contextBridge` se ven afectadas. Se trata de una omisión de aislamiento de contexto, lo que significa que el código que se ejecuta en el contexto mundial principal en el renderizador puede acceder al contexto aislado de Electron y realizar acciones privilegiadas. Este problema solo se puede explotar si una API expuesta al mundo principal a través de `contextBridge` puede devolver un objeto o matriz que contenga un objeto javascript que no se pueda serializar, por ejemplo, un contexto de representación de lienzo. Esto normalmente daría como resultado que se lanzara una excepción "Error: el objeto no se pudo clonar". El workaround del lado de la aplicación es garantizar que tal caso no sea posible. Asegúrese de que todos los valores devueltos por una función expuesta a través del puente de contexto sean compatibles. Este problema se solucionó en las versiones `25.0.0-alpha.2`, `24.0.1`, `23.2.3` y `22.3.6`.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-29198 changed 2024-09-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-p7v2-p9m8-qqg7 changed 2026-09-10CC-BY-4.0
NVDCVE-2023-29198 changed 2026-06-17Public domain