CVE-2026-12051

The USB DFU class implementation in Zephyr's new (experimental) device_next USB device stack contains a NULL pointer dereference in handle_download() (subsys/usb/device_next/class/usbd_dfu.c). The handler computes MIN(setup->wLength, buf->len) and passes buf->data to the image write callback without checking that the buf net_buf pointer is non-NULL. The handler is reached over the USB control endpoint, driven by the USB host. For a DFU_DNLOAD (download) request with no Data OUT stage — notably the zero-length terminating download that the DFU protocol uses to end a firmware transfer — the USB core invokes the class handler with a NULL buffer. After the device has been advanced to the DFU_DNLOAD_IDLE state (by sending one valid download block and a GET_STATUS), a zero-length DFU_DNLOAD reaches handle_download() with buf == NULL, dereferencing it. The result is a NULL+offset read that triggers a fatal CPU fault, i.e. a denial of service (device crash/reset). The attacker is whatever controls the USB host the device is attached to; DFU download support must be enabled with a registered image. There is no memory corruption or information disclosure — impact is limited to availability. The fix adds an explicit if (buf != NULL) guard so the callback receives a zero-length, NULL-data transfer instead of crashing.
Configurations

No configuration.

History

23 Oct 2026, 19:10

Type Values Removed Values Added
Summary
  • (es) La implementación de la clase USB DFU en la nueva (experimental) pila de dispositivos USB device_next de Zephyr contiene una desreferencia de puntero NULL en handle_download() (subsys/usb/device_next/class/usbd_dfu.c). El gestor calcula MIN(setup -> wLength, buf -> len) y pasa buf -> data a la función de devolución de llamada de escritura de imagen sin verificar que el puntero net_buf de buf no sea NULL. Se accede al gestor a través del punto final de control USB, impulsado por el host USB. Para una solicitud DFU_DNLOAD (descarga) sin una etapa de salida de datos (Data OUT) - en particular, la descarga de terminación de longitud cero que el protocolo DFU utiliza para finalizar una transferencia de firmware - el núcleo USB invoca al gestor de clase con un búfer NULL. Después de que el dispositivo ha avanzado al estado DFU_DNLOAD_IDLE (enviando un bloque de descarga válido y un GET_STATUS), una DFU_DNLOAD de longitud cero llega a handle_download() con buf == NULL, desreferenciándolo. El resultado es una lectura NULL+offset que desencadena un fallo fatal de la CPU, es decir, una denegación de servicio (bloqueo/reinicio del dispositivo). El atacante es quien controla el host USB al que está conectado el dispositivo; el soporte de descarga DFU debe estar habilitado con una imagen registrada. No hay corrupción de memoria ni revelación de información - el impacto se limita a la disponibilidad. La solución añade una protección explícita if (buf != NULL) para que la función de devolución de llamada reciba una transferencia de longitud cero y datos NULL en lugar de bloquearse.

Information

Published : 2026-08-11 06:17

Updated : 2026-10-23 19:10


NVD link : CVE-2026-12051

Mitre link : CVE-2026-12051

CVE.ORG link : CVE-2026-12051


JSON object : View

Products Affected

No product.

CWE
CWE-476

NULL Pointer Dereference