CVE-2026-102953: Use-after-free of control transfer buffer on timeout in USB host usbh_req_setup
usbhreqsetup() in subsys/usb/host/usbhch9.c returns -ETIMEDOUT as soon as a control request times out, even though the transfer is still in flight. usbhxferdequeue() only requests cancellation, and the host controller driver keeps the transfer and its data buffer until it returns it through the completion callback. Callers such as usbhreqdescdev() and usbhreqdesccfg() free the buffer (netbufunref()) right after usbhreqsetup() returns. Separately, a single global semaphore (ch9reqsync) with no mutual exclusion lets a late or foreign completion wake the wrong waiter. That waiter then returns early and its caller frees a buffer the controller is still filling.
A malicious USB device attached to a Zephyr USB host port can trigger this during enumeration. It NAKs a GETDESCRIPTOR request until the 5-second timeout expires, then answers with data around the cancellation, or delays its answer to the next request after leaving a stale semaphore signal. The controller driver (for example the MAX3421E max3421ehrsltsuccess() path) then writes device-controlled bytes into the freed netbuf and updates its length.
The result is a use-after-free write into the USB host buffer pool with attacker-chosen contents, which can corrupt buffers that have been reallocated to other transfers, plus a leak of transfer objects. Crashes or memory corruption follow. The fix serializes usbhreqsetup() with a mutex, resets the semaphore before each request, and waits for the driver to return a cancelled transfer before freeing it. Only builds with the experimental CONFIGUSBHOSTSTACK are affected.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In usbh_req_setup(), serialize requests with a mutex, reset ch9_req_sync before each request, and wait for the host controller driver to return a cancelled transfer before freeing its buffer.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Zephyr systems operating a USB host port are exposed when they enumerate an attached USB device. The described trigger requires a malicious USB device connected to that host port.
What does an attacker need to do to trigger the use-after-free?
The attacker needs to control a USB device presented to the Zephyr host during enumeration. The device can delay GET_DESCRIPTOR responses until the five-second timeout, then provide data around cancellation or during a subsequent request after a stale semaphore signal causes an early return.
Is user interaction or prior authentication required?
No prior privileges or user interaction are indicated. Exploitation depends on physical access to attach a malicious USB device to a Zephyr USB host port.
What is the impact after successful exploitation?
A host controller driver can write device-controlled bytes into a freed net_buf and update its length. The provided severity vector indicates low confidentiality impact and high integrity and availability impact.