# CVE-2024-46993: Electron Vulnerable to Heap Buffer Overflow in NativeImage::CreateFromPath

> Attackers can trigger heap buffer overflows in Electron apps via crafted images, potentially leading to code execution or crashes.

- **Severity:** Medium 4.4 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2025
- **Updated:** 2 Jul 2025
- **Also known as:** GHSA-6r2x-8pq8-9489

## What is CVE-2024-46993?

CVE-2024-46993 is a medium-severity memory corruption vulnerability in electron, published on 1 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Electron is an open source framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. In versions prior to 28.3.2, 29.3.3, and 30.0.3, 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. This issue has been patched in versions  28.3.2, 29.3.3, and 30.0.3. There are no workarounds for this issue.

Weakness: CWE-122 (Heap-based Buffer Overflow)

## Which versions are affected by CVE-2024-46993?

6 open source packages ship an affected version, including electron.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `electron` | npm | All versions | 28.3.2 |
| `electron` | npm | All versions | 28.3.2 |
| `electron` | npm | From 29.0.0-alpha.1 | 29.3.3 |
| `electron` | npm | From 29.0.0-alpha.1 | 29.3.3 |
| `electron` | npm | From 30.0.0-alpha.1 | 30.0.3 |
| `electron` | npm | From 30.0.0-alpha.1 | 30.0.3 |

## How do I fix CVE-2024-46993?

Upgrade electron to a fixed version for your release line: 28.3.2, 29.3.3 or 30.0.3.

## Is CVE-2024-46993 being exploited?

There is no known exploitation of CVE-2024-46993 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-46993 and fix it if it is affected.

What it is: CVE-2024-46993 is a medium-severity memory corruption vulnerability in electron, published on 1 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-46993 in the wild and no public exploit code.

Affected packages and fixed versions:
- electron (npm): affected all versions; fixed in 28.3.2
- electron (npm): affected all versions; fixed in 28.3.2
- electron (npm): affected from 29.0.0-alpha.1; fixed in 29.3.3
- electron (npm): affected from 29.0.0-alpha.1; fixed in 29.3.3
- electron (npm): affected from 30.0.0-alpha.1; fixed in 30.0.3
- electron (npm): affected from 30.0.0-alpha.1; fixed in 30.0.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-46993/ (Markdown: https://insights.sbomify.com/CVE-2024-46993/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-46993
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-46993
- OSV: https://osv.dev/vulnerability/CVE-2024-46993

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-46993/
Summaries are generated and may contain mistakes; the official description above is the record.
