CVE-2022-4135: Electron Heap Buffer Overflow Vulnerability

CRITICAL
Advisory Identifier: GHSA-995f-9x5r-2rcj
CVSS 9.6
CWE-787
Published
Advisory Summary

CVE-2022-4135 is a CRITICAL (CVSS 9.6) heap buffer overflow vulnerability (CWE-787: Out-of-bounds Write) affecting Electron libraries in the npm ecosystem. The issue involves heap buffer overflow in gpu. Remediation is available by upgrading affected packages to version 19.1.8.

CVE-2022-4135 at a Glance

CVE Identifier CVE-2022-4135
GHSA Identifier GHSA-995f-9x5r-2rcj
Severity CRITICAL
CVSS v3.1 Base Score 9.6
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-4135

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: 19.1.8
npm install electron@19.1.8
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-2022-4135, 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 19.1.8), 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-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended 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

Heap buffer overflow in GPU in Google Chrome prior to 107.0.5304.121 allowed a remote attacker who had compromised the renderer process to potentially perform a sandbox escape via a crafted HTML page. (Chromium security severity: High)

CVE-2022-4135 Affected Electron Versions

1 component(s)
Fixed Versions:
19.1.8
Product / Package Ecosystem Affected Versions Fixed Version
electron
npm
≥ 19.0.0
< 19.1.8
19.1.8

References

Frequently Asked Questions

What is CVE-2022-4135?
CVE-2022-4135 is a security vulnerability in Electron involving Heap buffer overflow in GPU under CWE-787: Out-of-bounds Write.
Which Electron versions are affected?
Affected versions include releases prior to 19.1.8 across affected packages: electron.
What version fixes CVE-2022-4135?
Upgrading to 19.1.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 19.1.8. Upgrade your dependency to 19.1.8 or later.
What is the CVSS score of CVE-2022-4135?
CVE-2022-4135 has a CVSS v3.1 base score of 9.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2022-4135?
CVE-2022-4135 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check npm dependencies for CVE-2022-4135?
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-995f-9x5r-2rcj",
  "modified" : "2022-11-28T23:33:19Z",
  "published" : "2022-11-25T03:30:19Z",
  "aliases" : [ "CVE-2022-4135" ],
  "summary" : "Heap buffer overflow in GPU",
  "details" : "Heap buffer overflow in GPU in Google Chrome prior to 107.0.5304.121 allowed a remote attacker who had compromised the renderer process to potentially perform a sandbox escape via a crafted HTML page. (Chromium security severity: High)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0"
      }, {
        "fixed" : "19.1.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-4135"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/pull/36444"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/pull/36447"
  }, {
    "type" : "WEB",
    "url" : "https://chromereleases.googleblog.com/2022/11/stable-channel-update-for-desktop_24.html"
  }, {
    "type" : "WEB",
    "url" : "https://crbug.com/1392715"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202305-10"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-28T23:33:19Z",
    "nvd_published_at" : "2022-11-25T01:15:00Z"
  }
}