CVE-2026-13216
Last modified
CVE-2026-13216 is a medium-severity vulnerability rated 6.1/10 on the CVSS scale. The virtio PCI driver (drivers/virtio/virtio_pci.c) parses a device's PCI capability list during driver initialization. In virtio_pci_read_cap() the device-supplied capability length byte cap_len (read from PCI config space via pcie_conf_read()) was only checked with assert(tmp.cap_len == cap_struct_size). EPSS estimates a 0.18% chance of exploitation in the next 30 days.
Description
The virtio PCI driver (drivers/virtio/virtio_pci.c) parses a device's PCI capability list during driver initialization. In virtio_pci_read_cap() the device-supplied capability length byte cap_len (read from PCI config space via pcie_conf_read()) was only checked with assert(tmp.cap_len == cap_struct_size). That assert resolves to __ASSERT_NO_MSG(), gated by CONFIG_ASSERT, which defaults off in production builds, so the value reached the copy logic completely unvalidated. The length then drives a loop that copies extra capability dwords into a fixed-size stack buffer supplied by the caller. A cap_len below the 24-byte base struct virtio_pci_cap underflows the unsigned extra_data_words count to a near-SIZE_MAX value, producing an effectively unbounded stack write; a cap_len above the caller's buffer (up to 255) writes up to roughly 228 bytes of device-controlled data past the buffer. Both are out-of-bounds writes of attacker-controlled content executed in kernel mode during boot-time device probe. The input originates from the virtio device. In the common deployment where Zephyr runs as a guest under a hypervisor, the device backend is the host, which already fully outranks the guest, so the bug yields no privilege escalation. The exploitable case is a virtio device that is untrusted relative to the Zephyr kernel — an untrusted or physical/passthrough virtio PCIe device on a bare-metal system, or a confidential-computing posture where the guest must defend against the host — where a malicious device can corrupt the kernel stack and potentially achieve code execution or a crash. The fix replaces the compiled-out assert with a runtime range check rejecting cap_len outside [sizeof(struct virtio_pci_cap), cap_struct_size] before any arithmetic or copy.
Metrics
Weakness Enumeration
Affected Software
Source: CNA advisory (CVE.org). NVD analysis pending.
| Vendor | Product | Versions |
|---|---|---|
| zephyrproject | zephyr | >= 4.2.0, < 4.4.2 |
References
Timeline
- Published
- Last Modified
- Status
- Awaiting Analysis
Frequently Asked Questions
What is CVE-2026-13216?
How severe is CVE-2026-13216?
How do I fix CVE-2026-13216?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2026
- CVE-2026-13210GitLab has remediated an issue in GitLab CE/EE affecting all…7.7
- CVE-2026-13211The genucenter web interface before version 8.0p11 unnecessa…4.3
- CVE-2026-13212The Zephyr virtio driver does not validate the descriptor-ch…8.8
- CVE-2026-13213The Hearing Access Service (HAS) GATT server in subsys/bluet…5.3
- CVE-2026-13214The OCPP 1.6 client in subsys/net/lib/ocpp/ocpp_j.c contains…9.8
- CVE-2026-13215The Zephyr ext2 filesystem driver fails to validate the s_lo…6.8
- CVE-2026-13217The OCPP 1.6 client in subsys/net/lib/ocpp/ocpp.c reconstruc…5.9
- CVE-2026-13218A flaw was found in KubeVirt's virt-handler network cache ha…4.2
- CVE-2026-1322GitLab has remediated an issue in GitLab CE/EE affecting all…8.1
- CVE-2026-13221Perl versions before 5.40.5-RC1, from 5.41.0 before 5.42.3-R…9.1
- CVE-2026-13222Our payment integration with Oppwa-based payment methods did…6.3
- CVE-2026-13223Our payment integration with Computop-based payment methods …6.3
Are you affected by CVE-2026-13216?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
