Improper Access Control Affecting electron package, versions <13.6.6>=14.0.0-beta.25 <14.2.4>=15.0.0-beta.1 <15.3.5>=16.0.0-beta.1 <16.0.6>=17.0.0-alpha.1 <17.0.0-alpha.6


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.14% (52nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Access Control vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-ELECTRON-2431353
  • published23 Mar 2022
  • disclosed22 Mar 2022
  • creditPalmerAL

Introduced: 22 Mar 2022

CVE-2022-21718  (opens in a new tab)
CWE-284  (opens in a new tab)

How to fix?

Upgrade electron to version 13.6.6, 14.2.4, 15.3.5, 16.0.6, 17.0.0-alpha.6 or higher.

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Improper Access Control via the web Bluetooth API, if the app has not configured a custom select-bluetooth-device event handler. The device that is accessed is random and the attacker would have no way of selecting a specific device.

Workarounds:

Adding this code to your app can workaround the issue.

app.on('web-contents-created', (event, webContents) => {
  webContents.on('select-bluetooth-device', (event, devices, callback) => {
    // Prevent default behavior
    event.preventDefault();
    // Cancel the request
    callback('');
  });
});

CVSS Scores

version 3.1