CVE-2018-1000118: Electron Electron Protocol Handler Browser Vulnerable Vulnerability

HIGH
Advisory Identifier: GHSA-fjqr-fx3f-g4rv
CVSS 8.8
CWE-78
Published
Advisory Summary

CVE-2018-1000118 is a HIGH (CVSS 8.8) electron protocol handler browser vulnerable vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Electron libraries in the npm ecosystem. The issue involves electron protocol handler browser vulnerable to command injection. Remediation is available by upgrading affected packages to version 1.8.2-beta5.

CVE-2018-1000118 at a Glance

CVE Identifier CVE-2018-1000118
GHSA Identifier GHSA-fjqr-fx3f-g4rv
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.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:R/S:U/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 Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2018-1000118

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: 1.8.2-beta5
npm install electron@1.8.2-beta5
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-2018-1000118, 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.8.2-beta5), 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. 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

Github Electron version Electron 1.8.2-beta.4 and earlier contains a Command Injection vulnerability in Protocol Handler that can result in command execute. This attack appear to be exploitable via the victim opening an electron protocol handler in their browser. This vulnerability appears to have been fixed in Electron 1.8.2-beta.5. This issue is due to an incomplete fix for CVE-2018-1000006, specifically the black list used was not case insensitive allowing an attacker to potentially bypass it.

CVE-2018-1000118 Affected Electron Versions

1 component(s)
Fixed Versions:
1.8.2-beta5
Product / Package Ecosystem Affected Versions Fixed Version
electron
npm
< 1.8.2-beta5
1.8.2-beta5

References

Frequently Asked Questions

What is CVE-2018-1000118?
CVE-2018-1000118 is a security vulnerability in Electron involving Electron protocol handler browser vulnerable to Command Injection under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Electron versions are affected?
Affected versions include releases prior to 1.8.2-beta5 across affected packages: electron.
What version fixes CVE-2018-1000118?
Upgrading to 1.8.2-beta5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 1.8.2-beta5. Upgrade your dependency to 1.8.2-beta5 or later.
What is the CVSS score of CVE-2018-1000118?
CVE-2018-1000118 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-1000118?
CVE-2018-1000118 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2018-1000118?
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-fjqr-fx3f-g4rv",
  "modified" : "2022-04-26T14:35:22Z",
  "published" : "2018-03-26T16:41:20Z",
  "aliases" : [ "CVE-2018-1000118" ],
  "summary" : "Electron protocol handler browser vulnerable to Command Injection",
  "details" : "Github Electron version Electron 1.8.2-beta.4 and earlier contains a Command Injection vulnerability in Protocol Handler that can result in command execute. This attack appear to be exploitable via the victim opening an electron protocol handler in their browser. This vulnerability appears to have been fixed in Electron 1.8.2-beta.5. This issue is due to an incomplete fix for CVE-2018-1000006, specifically the black list used was not case insensitive allowing an attacker to potentially bypass it.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.2-beta5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.8.2-beta4"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1000118"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/commit/ce361a12e355f9e1e99c989f1ea056c9e502dbe7"
  }, {
    "type" : "WEB",
    "url" : "https://electronjs.org/releases#1.8.2-beta.5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-fjqr-fx3f-g4rv"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:34:50Z",
    "nvd_published_at" : null
  }
}