CVE-2026-54257: Electron Buffer Performs Incorrect Byte Length Vulnerability

CRITICAL
Advisory Identifier: GHSA-q6m5-f73j-m9mc
CWE-120
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-54257
GHSA Identifier GHSA-q6m5-f73j-m9mc
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

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.

electron fixed: 42.3.3
npm install electron@42.3.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-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

### Impact Most apps will crash and some may perform incorrect buffer allocations in the Node.js `Buffer` API resulting in unexpected truncation or allocation. ### Workarounds No workarounds. Do not use these impacted Electron releases ### Fixed Versions * `42.3.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-2026-54257 Affected Electron Versions

1 component(s)
Fixed Versions:
42.3.3
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?
CVE-2026-54257 is a security vulnerability in Electron involving Buffer performs incorrect byte length calculations resulting in heap buffer under/overflow under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which Electron versions are affected?
Affected versions include releases prior to 42.3.3 across affected packages: electron.
What version fixes CVE-2026-54257?
Upgrading to 42.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 42.3.3. Upgrade your dependency to 42.3.3 or later.
What CWE is associated with CVE-2026-54257?
CVE-2026-54257 is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (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.).
How can I check npm dependencies for CVE-2026-54257?
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-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"
  }
}