# CVE-2026-17050: Double free of the USB host configuration descriptor when device enumeration fails

> A malicious USB device can trigger a double free in the Zephyr USB host stack, causing a denial of service or potential code execution.

- **Severity:** Medium 5.7 (`CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 21 Sep 2026
- **Updated:** 21 Sep 2026
- **Also known as:** GHSA-r7xw-9jhg-88cm

## What is CVE-2026-17050?

CVE-2026-17050 is a medium-severity use after free vulnerability in zephyrproject zephyr, published on 21 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

The experimental USB host stack allocates a per-device configuration-descriptor buffer, udev->cfg_desc, from the dedicated usb_device_heap in usbh_device_set_configuration() (subsys/usb/host/usbh_device.c). On three failure paths — a failed full-length GET_DESCRIPTOR(CONFIGURATION) read, a mismatch between the short and full descriptor reads, and a rejected descriptor in parse_configuration_descriptor() — the buffer was released with k_heap_free() but the pointer was left dangling. The cleanup in usbh_device_free() is guarded only by if (udev->cfg_desc != NULL), so it frees the same block a second time.

The path is driven entirely by the attached peripheral: usbh_device_connect() calls usbh_device_init(), which ends in usbh_device_set_configuration(), and on failure usbh_device_connect() calls usbh_device_free(). On v4.4.x this happens during the same enumeration, with no unplug required; on v4.1.0–v4.3.x the second free instead arrives via dev_removed_handler()/dev_connected_handler() in subsys/usb/host/usbh_core.c, so it requires a removal or duplicate-connect event after the failed enumeration — a sequence the attached device fully controls. A malicious or malformed USB device only has to answer the first 9-byte configuration-descriptor request with a well-formed header and then fail any of the three checks, for example by returning a full descriptor whose interface count disagrees with bNumInterfaces, or by answering the second read with different bytes.

The result is a double free on usb_device_heap. On builds where lib/heap hardening is active (the current default CONFIG_SYS_HEAP_HARDENING_BASIC), sys_heap_free() detects the already-free chunk and calls k_panic(), giving a deterministic, peripheral-triggered denial of service of the USB host. On builds without that detection — earlier releases, or CONFIG_SYS_HEAP_HARDENING_NONE — the second free manipulates a chunk already on the free list, corrupting the heap's free list so that later allocations can return overlapping or invalid blocks.

Exploitation beyond denial of service is bounded by the fact that usb_device_heap is a small dedicated heap (CONFIG_USBH_USB_DEVICE_HEAP, default 1024 bytes) whose only client is this descriptor buffer, and by CONFIG_USB_HOST_STACK being marked experimental and disabled by default. The fix sets udev->cfg_desc = NULL after every k_heap_free(), making the cleanup guard sound.

Weakness: CWE-415 (Double Free)

## Which versions are affected by CVE-2026-17050?


## How do I fix CVE-2026-17050?

No fix has been published for CVE-2026-17050 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-17050 being exploited?

There is no known exploitation of CVE-2026-17050 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-17050 and fix it if it is affected.

What it is: CVE-2026-17050 is a medium-severity use after free vulnerability in zephyrproject zephyr, published on 21 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-17050 in the wild and no public exploit code.

Affected product: zephyrproject zephyr. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-17050/ (Markdown: https://insights.sbomify.com/CVE-2026-17050/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-17050
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-17050
- OSV: https://osv.dev/vulnerability/CVE-2026-17050

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-17050/
Summaries are generated and may contain mistakes; the official description above is the record.
