codebytere

#50002: fix: validate USB device selection against filtered device list

Merged
Created: Mar 2, 2026, 6:05:55 AM
Merged: Mar 3, 2026, 3:44:34 AM
5 comments
Target: main

Description of Change

Previously, UsbChooserController::OnDeviceChosen looked up the chosen device_id via chooser_context_->GetDeviceInfo(), which searches all known USB devices on the system rather than the filtered list shown to the select-usb-device handler. This meant a device excluded by the renderer's filters or exclusion_filters could still be granted permission if the handler returned its GUID.

This aligns the USB chooser with the Serial and HID chooser implementations, which correctly validate against their filtered lists.

Checklist

Release Notes

Notes: none

Backports

38-x-y
Pending
Waiting for a manual backport
39-x-y
Merged
PR Number
#50047
Merged At
Mar 3, 2026, 8:07:20 AM
Released In
v39.8.0
Release Date
Mar 3, 2026, 10:03:24 AM
40-x-y
Merged
PR Number
#50048
Merged At
Mar 3, 2026, 8:08:04 AM
Released In
v40.7.0
Release Date
Mar 3, 2026, 10:03:33 AM
41-x-y
Merged
PR Number
#50049
Merged At
Mar 3, 2026, 8:27:31 AM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron