LowGHSA-3p22-ghq8-v749CVE-2022-21718

Renderers can obtain access to random bluetooth device without permission in Electron

Published 22 Mar 2022 · Updated 8 Nov 2023

Affected packages

Affected
<13.6.6
Fixed in
13.6.6
Update to the fixed version for your release line, for example:npm install electron@13.6.6
Affected
>=14.0.0-beta.1 <14.2.4
Fixed in
14.2.4
Update to the fixed version for your release line, for example:npm install electron@14.2.4
Affected
>=15.0.0-beta.1 <15.3.5
Fixed in
15.3.5
Update to the fixed version for your release line, for example:npm install electron@15.3.5
Affected
>=16.0.0-beta.1 <16.0.6
Fixed in
16.0.6
Update to the fixed version for your release line, for example:npm install electron@16.0.6
Affected
>=17.0.0-alpha.1 <17.0.0-alpha.6
Fixed in
17.0.0-alpha.6
Update to the fixed version for your release line, for example:npm install electron@17.0.0-alpha.6

Details

Impact

This vulnerability allows renderers to obtain access to a random bluetooth device 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.

All current stable versions of Electron are affected.

Patches

This has been patched and the following Electron versions contain the fix:

  • 17.0.0-alpha.6
  • 16.0.6
  • 15.3.5
  • 14.2.4
  • 13.6.6

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('');
  });
});

For more information If you have any questions or comments about this advisory, email us at security@electronjs.org.

Is GHSA-3p22-ghq8-v749 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected electron, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.