Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2026-13216— Out-of-bounds stack write in Zephyr virtio PCI driver from unvalidated device-supplied capability length

Quick assessment

Affected
zephyrproject zephyr
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

virtio PCI 驱动程序(drivers/virtio/virtio_pci.c)在驱动初始化期间会解析设备的 PCI 能力列表。在 函数中,设备提供的能力长度字节 (通过 从 PCI 配置空间读取)仅使用 进行检查。该断言在启用 时才会生效,而在生产构建中默认关闭,因此该值在到达复制逻辑时完全未经验证。 该长度随后用于驱动一个循环,将额外的能力双字(dwords)复制到调用者提供的固定大小栈缓冲区中。如果 小于基础结构体 的 24 字节,会导致无符号变量 发生下溢,接近 ,从而产生近乎无限的栈写入;如果 超

CVSS 6.1 · Medium

Affected Version Matrix 1

VendorProduct Version RangeStatus
zephyrproject zephyr 4.2.0< 4.4.2 affected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-13216

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Out-of-bounds stack write in Zephyr virtio PCI driver from unvalidated device-supplied capability length
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
跨界内存写
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
zephyrproject zephyr 4.2.0 ~ 4.4.2 -

II. Public POCs for CVE-2026-13216

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-13216

登录查看更多情报信息。

Patches & Fixes for CVE-2026-13216 (1)

Vendor Advisories for CVE-2026-13216 (1)

Same Patch Batch · zephyrproject · 2026-08-25 · 5 CVEs total

CVE-2026-13214 9.8 CRITICAL Stack buffer overflow in OCPP GetConfiguration key parsing
CVE-2026-13215 6.8 MEDIUM Zephyr ext2 mount: unvalidated superblock block size causes out-of-bounds write from a cra
CVE-2026-13217 5.9 MEDIUM NULL-pointer dereference in Zephyr OCPP CALLRESULT parsing via unchecked strtok_r/atoi
CVE-2026-13478 5.5 MEDIUM Out-of-bounds read in Zephyr ext2 block-bitmap validation from a crafted s_blocks_count

IV. Related Vulnerabilities

V. Comments for CVE-2026-13216

No comments yet


Leave a comment