CVE-2020-4075: Electron Arbitrary File Read Vulnerability
MODERATECVE-2020-4075 is a MODERATE (CVSS 6.8) arbitrary file read vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Electron libraries in the npm ecosystem. The issue involves arbitrary file read via window-open ipc in electron. Remediation is available by upgrading affected packages to version 7.2.4, 8.2.4.
CVE-2020-4075 at a Glance
Security Impact
CVSS: 6.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2020-4075
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@7.2.4
npm install electron@8.2.4
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-2020-4075, 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 7.2.4), 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-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. 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-2020-4075 Affected Electron Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
electron
|
npm |
< 7.2.4
|
7.2.4
|
|
electron
|
npm |
≥ 8.0.0
< 8.2.4
|
8.2.4
|
References
Frequently Asked Questions
What is CVE-2020-4075?
Which Electron versions are affected?
What version fixes CVE-2020-4075?
Is electron affected?
What is the CVSS score of CVE-2020-4075?
What CWE is associated with CVE-2020-4075?
How can I check npm dependencies for CVE-2020-4075?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f9mq-jph6-9mhm",
"modified" : "2021-01-07T23:48:36Z",
"published" : "2020-07-07T00:01:13Z",
"aliases" : [ "CVE-2020-4075" ],
"summary" : "Arbitrary file read via window-open IPC in Electron",
"details" : "### Impact\nThe vulnerability allows arbitrary local file read by defining unsafe window options on a child window opened via window.open.\n\n### Workarounds\nEnsure you are calling `event.preventDefault()` on all [`new-window`](https://electronjs.org/docs/api/web-contents#event-new-window) events where the `url` or `options` is not something you expect.\n\n### Fixed Versions\n* `9.0.0-beta.21`\n* `8.2.4`\n* `7.2.4`\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [security@electronjs.org](mailto:security@electronjs.org)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "electron"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.2.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "electron"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.2.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/electron/electron/security/advisories/GHSA-f9mq-jph6-9mhm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-4075"
}, {
"type" : "WEB",
"url" : "https://www.electronjs.org/releases/stable?page=3#release-notes-for-v824"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-552" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-07-06T23:54:56Z",
"nvd_published_at" : null
}
}