Improper Access Control Affecting org.webjars.npm:electron package, versions [,32.0.1)


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.95% (58th 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 IDSNYK-JAVA-ORGWEBJARSNPM-2431354
  • 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 org.webjars.npm:electron to version 32.0.1 or higher.

Overview

org.webjars.npm: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 Base Scores

version 3.1