Closed Bug 2033163 Opened 4 months ago Closed 3 months ago

Remove system ports from WebSerial port list on macOS

Categories

(Core :: DOM: Web Serial, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: haik, Assigned: gstoll)

References

Details

Attachments

(1 file)

On a macOS Apple Silicon MacBook Pro, when no external devices are connected, the following serial ports are listed in the port picker.

/dev/cu.wlan-debug                                 
/dev/cu.debug-console                                                         
/dev/cu.Bluetooth-Incoming-Port

I haven't found authoritative sources, but online information suggests they're used for WiFi debugging, kernel debugging, and for bluetooth devices over serial respectively.

The Bluetooth serial port may make sense for WebSerial, but WiFI debugging and kernel debugging don't need to be exposed.

Let's remove these ports (potentially keeping the Bluetooth port) from the port picker list to reduce attack surface and reduce user confusion when having to pick a port.

On an x64 MacBook Pro 2018, the list is

/dev/cu.BLTH
/dev/cu.Bluetooth-Incoming-Port

Note that Chrome does show all of these as choices (at least on my Apple Silicon Mac Mini). But I think removing the WiFi and kernel debugging ones explicitly makes sense.

I have a try build that does this, but the names were a little different - can you try this and see if it removes wlan-debug and debug-console for you?

Flags: needinfo?(haftandilian)

This is from Apple Silicon on macOS 26.5 on a M3 MacBook Pro. I'll leave the needinfo to also test on x64. Yes it removes wlan-debug and debug-console and keeps Bluetooth-Incoming-Port.

[Child 4640: Main Thread]: D/WebSerial Serial[1103dc790] created for window
[Child 4640: Main Thread]: I/WebSerial Serial[1103dc790]::RequestPort called (filters: none, allowedBluetoothUUIDs: none)
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660] created
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::InitializeMacOS setting up IOKit notifications
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::InitializeMacOS added run loop source to main run loop
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::InitializeMacOS draining initial added device iterator
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::OnDeviceAdded skip=1 device : path=/dev/tty.Bluetooth-Incoming-Port, friendlyName=Bluetooth-Incoming-Port, VID=0x0000, PID=0x0000
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::OnDeviceAdded skip=1 device : path=/dev/tty.ESP32-WebSerial-V2, friendlyName=ESP32-WebSerial-V2, VID=0x0000, PID=0x0000
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::ExtractDeviceInfo filtering macOS system port: /dev/tty.debug-console
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::ExtractDeviceInfo filtering macOS system port: /dev/tty.wlan-debug
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::OnDeviceAdded processed 4 devices (skipNotify=1)
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::InitializeMacOS draining initial removed device iterator
[Parent 4631: Main Thread]: D/WebSerial PosixSerialPlatformService[14d3af660]::OnDeviceRemoved processed 0 devices (skipNotify=1)
[Parent 4631: Main Thread]: I/WebSerial PosixSerialPlatformService[14d3af660]::InitializeMacOS monitoring started
[Parent 4631: BackgroundThreadPool #1]: D/WebSerial PosixSerialPlatformService[14d3af660]::EnumeratePorts starting enumeration
[Parent 4631: BackgroundThreadPool #1]: D/WebSerial PosixSerialPlatformService[14d3af660]::ExtractDeviceInfo filtering macOS system port: /dev/tty.wlan-debug
[Parent 4631: BackgroundThreadPool #1]: D/WebSerial PosixSerialPlatformService[14d3af660]::ExtractDeviceInfo filtering macOS system port: /dev/tty.debug-console
[Parent 4631: BackgroundThreadPool #1]: D/WebSerial PosixSerialPlatformService[14d3af660]::EnumeratePorts found port: path=/dev/tty.ESP32-WebSerial-V2, friendlyName=ESP32-WebSerial-V2, VID=0x0000, PID=0x0000
[Parent 4631: BackgroundThreadPool #1]: D/WebSerial PosixSerialPlatformService[14d3af660]::EnumeratePorts found port: path=/dev/tty.Bluetooth-Incoming-Port, friendlyName=Bluetooth-Incoming-Port, VID=0x0000, PID=0x0000
[Parent 4631: BackgroundThreadPool #1]: D/WebSerial PosixSerialPlatformService[14d3af660]::EnumeratePorts found 2 ports
[Parent 4631: Main Thread]: I/WebSerial SerialPermissionRequest::GetTypes called with 2 ports
[Parent 4631: Main Thread]: D/WebSerial   Port[0]: path=/dev/tty.ESP32-WebSerial-V2, friendlyName=ESP32-WebSerial-V2, vid=0x0000, pid=0x0000
[Parent 4631: Main Thread]: D/WebSerial   Port[1]: path=/dev/tty.Bluetooth-Incoming-Port, friendlyName=Bluetooth-Incoming-Port, vid=0x0000, pid=0x0000

:hballent verified that this works on an x64 Mac as well.

Flags: needinfo?(haftandilian)
Assignee: nobody → gstoll
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
QA Whiteboard: [qa-triage-done-c153/b152]
Component: DOM: Device Interfaces → Dom: Web Serial
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: