CVE-2020-15174: Electron Unpreventable Top-level Navigation Vulnerability

HIGH
Advisory Identifier: GHSA-2q4g-w47c-4674
CVSS 7.5
CWE-693 CWE-20
Published
Advisory Summary

CVE-2020-15174 is a HIGH (CVSS 7.5) unpreventable top-level navigation vulnerability (CWE-693: Protection Mechanism Failure) affecting Electron libraries in the npm ecosystem. The issue involves unpreventable top-level navigation. Remediation is available by upgrading affected packages to version 8.5.1, 9.3.0, 10.0.1.

CVE-2020-15174 at a Glance

CVE Identifier CVE-2020-15174
GHSA Identifier GHSA-2q4g-w47c-4674
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-693: Protection Mechanism Failure
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:H/A:L).

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

How to Fix CVE-2020-15174

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: 8.5.1
npm install electron@8.5.1
electron fixed: 9.3.0
npm install electron@9.3.0
electron fixed: 10.0.1
npm install electron@10.0.1
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-2020-15174, 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 8.5.1), 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-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. 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

### Impact The `will-navigate` event that apps use to prevent navigations to unexpected destinations [as per our security recommendations](https://www.electronjs.org/docs/tutorial/security) can be bypassed when a sub-frame performs a top-frame navigation across sites. ### Patches * `11.0.0-beta.1` * `10.0.1` * `9.3.0` * `8.5.1` ### Workarounds Sandbox all your iframes using the [`sandbox` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox). This will prevent them creating top-frame navigations and is good practice anyway. ### For more information If you have any questions or comments about this advisory: * Email us at security@electronjs.org

CVE-2020-15174 Affected Electron Versions

3 component(s)
Fixed Versions:
8.5.19.3.010.0.1
Product / Package Ecosystem Affected Versions Fixed Version
electron
npm
≥ 8.0.0-beta.0
< 8.5.1
8.5.1
electron
npm
≥ 9.0.0-beta.0
< 9.3.0
9.3.0
electron
npm
≥ 10.0.0-beta.0
< 10.0.1
10.0.1

References

Frequently Asked Questions

What is CVE-2020-15174?
CVE-2020-15174 is a security vulnerability in Electron involving Unpreventable top-level navigation under CWE-693: Protection Mechanism Failure.
Which Electron versions are affected?
Affected versions include releases prior to 8.5.1, 9.3.0, 10.0.1 across affected packages: electron.
What version fixes CVE-2020-15174?
Upgrading to 8.5.1, 9.3.0, 10.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 8.5.1, 9.3.0, 10.0.1. Upgrade your dependency to 8.5.1, 9.3.0, 10.0.1 or later.
What is the CVSS score of CVE-2020-15174?
CVE-2020-15174 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:L.
What CWE is associated with CVE-2020-15174?
CVE-2020-15174 is classified under CWE-693: Protection Mechanism Failure (The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.).
How can I check npm dependencies for CVE-2020-15174?
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-2q4g-w47c-4674",
  "modified" : "2021-11-19T14:44:04Z",
  "published" : "2020-10-06T14:24:04Z",
  "aliases" : [ "CVE-2020-15174" ],
  "summary" : "Unpreventable top-level navigation",
  "details" : "### Impact\nThe `will-navigate` event that apps use to prevent navigations to unexpected destinations [as per our security recommendations](https://www.electronjs.org/docs/tutorial/security) can be bypassed when a sub-frame performs a top-frame navigation across sites.\n\n### Patches\n\n* `11.0.0-beta.1`\n* `10.0.1`\n* `9.3.0`\n* `8.5.1`\n\n### Workarounds\nSandbox all your iframes using the [`sandbox` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox).  This will prevent them creating top-frame navigations and is good practice anyway.\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Email us at security@electronjs.org",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0-beta.0"
      }, {
        "fixed" : "8.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0-beta.0"
      }, {
        "fixed" : "9.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0-beta.0"
      }, {
        "fixed" : "10.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/security/advisories/GHSA-2q4g-w47c-4674"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15174"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/commit/18613925610ba319da7f497b6deed85ad712c59b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/electron/electron"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-693" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-10-06T14:12:16Z",
    "nvd_published_at" : "2020-10-06T18:15:00Z"
  }
}