CVE-2022-29257: Electron AutoUpdater Module Fails To Validate Vulnerability

MODERATE
Advisory Identifier: GHSA-77xc-hjv8-ww97
CVSS 6.6
CWE-20
Published
Advisory Summary

CVE-2022-29257 is a MODERATE (CVSS 6.6) autoupdater module fails to validate vulnerability (CWE-20: Improper Input Validation) affecting Electron libraries in the npm ecosystem. The issue involves autoupdater module fails to validate certain nested components of the bundle. Remediation is available by upgrading affected packages to version 15.5.0, 16.2.0, 17.2.0, 18.0.0-beta.6.

CVE-2022-29257 at a Glance

CVE Identifier CVE-2022-29257
GHSA Identifier GHSA-77xc-hjv8-ww97
Severity MODERATE
CVSS v3.1 Base Score 6.6
CWE Classification CWE-20: Improper Input Validation
Affected Product Electron
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H).

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

How to Fix CVE-2022-29257

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: 15.5.0
npm install electron@15.5.0
electron fixed: 16.2.0
npm install electron@16.2.0
electron fixed: 17.2.0
npm install electron@17.2.0
electron fixed: 18.0.0-beta.6
npm install electron@18.0.0-beta.6
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-2022-29257, 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 15.5.0), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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 This vulnerability allows attackers who have control over a given apps update server / update storage to serve maliciously crafted update packages that pass the code signing validation check but contain malicious code in some components. Please note that this kind of attack would require **significant** privileges in your own auto updating infrastructure and the ease of that attack entirely depends on your infrastructure security. ### Patches This has been patched and the following Electron versions contain the fix: * `18.0.0-beta.6` * `17.2.0` * `16.2.0` * `15.5.0` ### Workarounds There are no workarounds for this issue, please update to a patched version of Electron. ### For more information If you have any questions or comments about this advisory, email us at [security@electronjs.org](mailto:security@electronjs.org)

CVE-2022-29257 Affected Electron Versions

4 component(s)
Fixed Versions:
15.5.016.2.017.2.018.0.0-beta.6
Product / Package Ecosystem Affected Versions Fixed Version
electron
npm
< 15.5.0
15.5.0
electron
npm
≥ 16.0.0
< 16.2.0
16.2.0
electron
npm
≥ 17.0.0
< 17.2.0
17.2.0
electron
npm
≥ 18.0.0-beta.1
< 18.0.0-beta.6
18.0.0-beta.6

References

Frequently Asked Questions

What is CVE-2022-29257?
CVE-2022-29257 is a security vulnerability in Electron involving AutoUpdater module fails to validate certain nested components of the bundle under CWE-20: Improper Input Validation.
Which Electron versions are affected?
Affected versions include releases prior to 15.5.0, 16.2.0, 17.2.0, 18.0.0-beta.6 across affected packages: electron.
What version fixes CVE-2022-29257?
Upgrading to 15.5.0, 16.2.0, 17.2.0, 18.0.0-beta.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is electron affected?
Yes, electron is affected in releases prior to 15.5.0, 16.2.0, 17.2.0, 18.0.0-beta.6. Upgrade your dependency to 15.5.0, 16.2.0, 17.2.0, 18.0.0-beta.6 or later.
What is the CVSS score of CVE-2022-29257?
CVE-2022-29257 has a CVSS v3.1 base score of 6.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-29257?
CVE-2022-29257 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2022-29257?
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-77xc-hjv8-ww97",
  "modified" : "2022-06-29T21:48:38Z",
  "published" : "2022-06-16T23:18:47Z",
  "aliases" : [ "CVE-2022-29257" ],
  "summary" : "AutoUpdater module fails to validate certain nested components of the bundle",
  "details" : "### Impact\nThis vulnerability allows attackers who have control over a given apps update server / update storage to serve maliciously crafted update packages that pass the code signing validation check but contain malicious code in some components.\n\nPlease note that this kind of attack would require **significant** privileges in your own auto updating infrastructure and the ease of that attack entirely depends on your infrastructure security.\n\n### Patches\nThis has been patched and the following Electron versions contain the fix:\n\n* `18.0.0-beta.6`\n* `17.2.0`\n* `16.2.0`\n* `15.5.0`\n\n### Workarounds\nThere are no workarounds for this issue, please update to a patched version of Electron.\n\n### For more information\nIf you have any questions or comments about this advisory, email us at [security@electronjs.org](mailto:security@electronjs.org)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "15.5.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.0.0"
      }, {
        "fixed" : "16.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "17.0.0"
      }, {
        "fixed" : "17.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "electron"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "18.0.0-beta.1"
      }, {
        "fixed" : "18.0.0-beta.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 18.0.0-beta.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/electron/electron/security/advisories/GHSA-77xc-hjv8-ww97"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29257"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/electron/electron"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-16T23:18:47Z",
    "nvd_published_at" : "2022-06-13T22:15:00Z"
  }
}