CVE-2026-104931: NULL pointer dereference in USB device_next class handlers on zero-length control OUT requests
Since the control-transfer rework in the devicenext USB device stack, usbdhandlectrlxfer() in subsys/usb/devicenext/usbdch9.c calls a class's controltodev handler with a NULL buffer when a host-to-device request has no data stage (wLength == 0). Several in-tree handlers dereference that buffer anyway: bthcictd() (Bluetooth HCI over USB), usbdhidctd()/handlesetreport() (HID SETREPORT), uvccontroltodev() (UVC SETCUR, reaching uvcsetvsprobe(), uvcsetvscommit() and uvcsetvcctrl()), and lbcontroltodev() (loopback test class). Each reads buf->data/buf->len from a NULL pointer.
The USB host controls every SETUP field. Any host the device is connected to can trigger the bug by sending one class or vendor OUT control request with wLength = 0 to the affected interface. No authentication is involved. HID devices are affected when the application registers a setreport callback, for example keyboards with LED output reports.
On platforms that trap NULL accesses (MPU/DWT null-pointer detection, unmapped low memory, MMU-based targets), the result is a fault that crashes or resets the device. On Cortex-M parts without null-pointer detection (the default), the handlers read a bogus pointer and length from the vector table near address 0 and pass them on, for example to the application's HID setreport callback, which is undefined behavior. The in-tree copies stay bounded by destination sizes, so the impact is denial of service.
Affected Software
Event History
Frequently Asked Questions
Which USB device configurations are affected?
Affected configurations include Bluetooth HCI over USB, HID devices that register a set_report callback, UVC devices handling SET_CUR requests, and the loopback test class. HID examples include keyboards that support LED output reports.
What does an attacker need to exploit this issue?
An attacker only needs to be a USB host connected to the device. They can send a class or vendor OUT control request with wLength set to 0 to an affected interface; no authentication is required.
What is the expected impact on platforms that detect NULL accesses?
On platforms with MPU/DWT NULL-pointer detection, unmapped low memory, or MMU-based protections, dereferencing the NULL buffer causes a fault that crashes or resets the device.