CVE-2024-46993: Electron Electron Vulnerable To Heap Buffer Vulnerability

MODERATE
Advisory Identifier: GHSA-6r2x-8pq8-9489
CWE-122
Published
Advisory Summary

CVE-2024-46993 is a MODERATE electron vulnerable to heap buffer vulnerability (CWE-122: Heap-based Buffer Overflow) affecting Electron libraries in the npm ecosystem. The issue involves electron vulnerable to heap buffer overflow in nativeimage. Remediation is available by upgrading affected packages to version 28.3.2, 29.3.3, 30.0.3.

CVE-2024-46993 at a Glance

CVE Identifier CVE-2024-46993
GHSA Identifier GHSA-6r2x-8pq8-9489
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-122: Heap-based Buffer Overflow
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2024-46993

To remediate this vulnerability, upgrade all affected Electron dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

electron fixed: 28.3.2
npm install electron@28.3.2
electron fixed: 29.3.3
npm install electron@29.3.3
electron fixed: 30.0.3
npm install electron@30.0.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls electron

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-46993, inspect your project dependencies using npm:

npm ls electron

Analyze the terminal output to locate any version of Electron in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 28.3.2), your application is affected.

Note: The npm ls electron command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-122: Heap-based Buffer Overflow, where a heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). In Electron, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The `nativeImage.createFromPath()` and `nativeImage.createFromBuffer()` functions call a function downstream that is vulnerable to a heap buffer overflow. An Electron program that uses either of the affected functions is vulnerable to a buffer overflow if an attacker is in control of the image's height, width, and contents. ### Workaround There are no app-side workarounds for this issue. You must update your Electron version to be protected. ### Patches - `v28.3.2` - `v29.3.3` - `v30.0.3` ### For More Information If you have any questions or comments about this advisory, email us at [security@electronjs.org](mailto:security@electronjs.org).

CVE-2024-46993 Affected Electron Versions

3 component(s)
Fixed Versions:
28.3.229.3.330.0.3
Product / Package Ecosystem Affected Versions Fixed Version
electron
npm
< 28.3.2
28.3.2
electron
npm
≥ 29.0.0-alpha.1
< 29.3.3
29.3.3
electron
npm
≥ 30.0.0-alpha.1
< 30.0.3
30.0.3

References

Frequently Asked Questions

What is CVE-2024-46993?
CVE-2024-46993 is a security vulnerability in Electron involving Electron vulnerable to Heap Buffer Overflow in NativeImage under CWE-122: Heap-based Buffer Overflow.
Which Electron versions are affected?
Affected versions include releases prior to 28.3.2, 29.3.3, 30.0.3 across affected packages: electron.
What version fixes CVE-2024-46993?
Upgrading to 28.3.2, 29.3.3, 30.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 28.3.2, 29.3.3, 30.0.3. Upgrade your dependency to 28.3.2, 29.3.3, 30.0.3 or later.
What CWE is associated with CVE-2024-46993?
CVE-2024-46993 is classified under CWE-122: Heap-based Buffer Overflow (A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().).
How can I check npm dependencies for CVE-2024-46993?
Run the dependency tree command: 'npm ls electron'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6r2x-8pq8-9489",
  "modified" : "2025-07-01T13:13:25Z",
  "published" : "2025-06-30T18:41:08Z",
  "aliases" : [ "CVE-2024-46993" ],
  "summary" : "Electron vulnerable to Heap Buffer Overflow in NativeImage",
  "details" : "### Impact\nThe `nativeImage.createFromPath()` and `nativeImage.createFromBuffer()` functions call a function downstream that is vulnerable to a heap buffer overflow. An Electron program that uses either of the affected functions is vulnerable to a buffer overflow if an attacker is in control of the image's height, width, and contents.\n\n### Workaround\nThere are no app-side workarounds for this issue. You must update your Electron version to be protected.\n\n### Patches\n\n- `v28.3.2`\n- `v29.3.3`\n- `v30.0.3`\n\n### For More Information\n\nIf you have any questions or comments about this advisory, email us at [security@electronjs.org](mailto:security@electronjs.org).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "28.3.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "29.0.0-alpha.1"
      }, {
        "fixed" : "29.3.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "30.0.0-alpha.1"
      }, {
        "fixed" : "30.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/security/advisories/GHSA-6r2x-8pq8-9489"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-46993"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/electron/electron"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-122" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-30T18:41:08Z",
    "nvd_published_at" : "2025-07-01T03:15:21Z"
  }
}