CVE-2026-54257: Electron Buffer Performs Incorrect Byte Length Vulnerability
CRITICALCVE-2026-54257 is a CRITICAL buffer performs incorrect byte length vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting Electron libraries in the npm ecosystem. The issue involves buffer performs incorrect byte length calculations resulting in heap buffer under/overflow. Remediation is available by upgrading affected packages to version 42.3.3.
CVE-2026-54257 at a Glance
How to Fix CVE-2026-54257
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.
npm install electron@42.3.3
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-2026-54257, 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 42.3.3), 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-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. 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
CVE-2026-54257 Affected Electron Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
electron
|
npm |
≥ 42.3.1
< 42.3.3
|
42.3.3
|
References
Frequently Asked Questions
What is CVE-2026-54257?
Which Electron versions are affected?
What version fixes CVE-2026-54257?
Is electron affected?
What CWE is associated with CVE-2026-54257?
How can I check npm dependencies for CVE-2026-54257?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q6m5-f73j-m9mc",
"modified" : "2026-07-20T21:02:00Z",
"published" : "2026-06-15T20:20:24Z",
"aliases" : [ "CVE-2026-54257" ],
"summary" : "Electron: Buffer performs incorrect byte length calculations resulting in heap buffer under/overflow",
"details" : "### Impact\nMost apps will crash and some may perform incorrect buffer allocations in the Node.js `Buffer` API resulting in unexpected truncation or allocation.\n\n### Workarounds\nNo workarounds. Do not use these impacted Electron releases\n\n### Fixed Versions\n* `42.3.3`\n\n### For more information\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:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "electron"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "42.3.1"
}, {
"fixed" : "42.3.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/electron/electron/security/advisories/GHSA-q6m5-f73j-m9mc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54257"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/electron/electron"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-120" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-15T20:20:24Z",
"nvd_published_at" : "2026-06-23T18:18:07Z"
}
}