CVE-2022-4135: Electron Heap Buffer Overflow Vulnerability
CRITICALCVE-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
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).
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.
npm install electron@19.1.8
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
CVE-2022-4135 Affected Electron Versions
1 component(s)| 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?
Which Electron versions are affected?
What version fixes CVE-2022-4135?
Is electron affected?
What is the CVSS score of CVE-2022-4135?
What CWE is associated with CVE-2022-4135?
How can I check npm dependencies for CVE-2022-4135?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}