VDB
Sign up
MEDIUM5.4

GHSA-fw47-9c62-h3vw

Electron: HID and USB permission checks can be attributed to the wrong origin

Quick fix

GHSA-fw47-9c62-h3vw — electron: upgrade to the fixed version with the command below.

npm install electron@45.0.0-alpha.5

Details

### Impact For `hid` and `usb` permission checks made from an iframe, `session.setPermissionCheckHandler` was given the top-level frame's origin and details instead of the requesting frame's. Apps that allow these permissions based on origin could grant an embedded frame access intended for the top-level page.

You're only affected if you use `setPermissionCheckHandler` with origin-based logic for `hid` or `usb` and embed cross-origin iframes with `allow="hid"` or `allow="usb"`. Apps that don't delegate those features to untrusted iframes are not affected.

### Workarounds Don't add `allow="hid"` / `allow="usb"` to untrusted iframes, or make the decision in your `select-hid-device` / `select-usb-device` handler using `details.frame`.

### Fixed Versions * `45.0.0-alpha.5` * `44.3.0` * `43.7.0` * `42.11.3`

### For more information If you have any questions or comments about this advisory, email us at [security@electronjs.org](mailto:security@electronjs.org)

Are you affected?

Enter the version of the package you're using.

Affected packages

npm/electron
Introduced in: 45.0.0-alpha.1Fixed in: 45.0.0-alpha.5
Fixnpm install electron@45.0.0-alpha.5
npm/electron
Introduced in: 44.0.0-alpha.1Fixed in: 44.3.0
Fixnpm install electron@44.3.0
npm/electron
Introduced in: 43.0.0-alpha.1Fixed in: 43.7.0
Fixnpm install electron@43.7.0
npm/electron
Introduced in: 0Fixed in: 42.11.3
Fixnpm install electron@42.11.3

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:npm/electron"]}'