CVE-2017-16151: Electron Remote Code Execution Vulnerability
CRITICALCVE-2017-16151 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Electron libraries in the npm ecosystem. The issue involves chromium remote code execution in electron. Remediation is available by upgrading affected packages to version 1.6.14, 1.7.8.
CVE-2017-16151 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2017-16151
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@1.6.14
npm install electron@1.7.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-2017-16151, 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 1.6.14), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. 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-2017-16151 Affected Electron Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
electron
|
npm |
< 1.6.14
|
1.6.14
|
|
electron
|
npm |
≥ 1.7.0
< 1.7.8
|
1.7.8
|
References
Frequently Asked Questions
What is CVE-2017-16151?
Which Electron versions are affected?
What version fixes CVE-2017-16151?
Is electron affected?
What is the CVSS score of CVE-2017-16151?
What CWE is associated with CVE-2017-16151?
How can I check npm dependencies for CVE-2017-16151?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4w88-rjj3-x7wp",
"modified" : "2023-09-13T19:15:15Z",
"published" : "2018-07-24T20:04:23Z",
"aliases" : [ "CVE-2017-16151" ],
"summary" : "Chromium Remote Code Execution in electron",
"details" : "Affected versions of `ElectronJS` are susceptible to a remote code execution vulnerability that occurs when an affected application access remote content, even if the [sandbox option](https://electron.atom.io/docs/api/sandbox-option) is enabled.\n\n\n\n## Recommendation\n\nUpdate to electron version 1.7.8 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "electron"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.6.14"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "electron"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.7.0"
}, {
"fixed" : "1.7.8"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16151"
}, {
"type" : "WEB",
"url" : "https://electron.atom.io/blog/2017/09/27/chromium-rce-vulnerability-fix"
}, {
"type" : "WEB",
"url" : "https://electronjs.org/blog/chromium-rce-vulnerability"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-4w88-rjj3-x7wp"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/539"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T20:59:23Z",
"nvd_published_at" : null
}
}