CVE-2026-13216
Received Received - Intake

Buffer Overflow in Zephyr RTOS Virtio PCI Driver

Vulnerability report for CVE-2026-13216, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-25

Last updated on: 2026-08-25

Assigner: Zephyr Project

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-25
Last Modified
2026-08-25
Generated
2026-08-25
AI Q&A
2026-08-25
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 3 associated CPEs
Vendor Product Version / Range
zephyrproject zephyr From 4.2.0 (inc) to 4.4.1 (inc)
zephyrproject zephyr 4.4.2
zephyrproject zephyr *

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is in the Zephyr RTOS virtio PCI driver where the function virtio_pci_read_cap() reads a device-supplied capability length (cap_len) from PCI config space without proper validation. The cap_len is only checked with an assert() that is disabled in production builds, allowing unvalidated values to proceed. This leads to either an underflow or overflow in a stack buffer during device probe, causing attacker-controlled data to corrupt the kernel stack.

Detection Guidance

This vulnerability is specific to the Zephyr RTOS virtio PCI driver and requires kernel-level inspection. There are no direct network detection commands. To check for affected versions, inspect your Zephyr project's version against the vulnerable range (4.2.0 to 4.4.1). Use commands like 'git log --oneline' or check version files in your project directory.

Impact Analysis

In typical hypervisor guest setups, this vulnerability is not exploitable due to the host's higher privilege. However, on bare-metal systems with untrusted virtio devices or in confidential computing environments, a malicious device could corrupt the kernel stack, potentially causing crashes or enabling code execution.

Compliance Impact

This vulnerability could lead to unauthorized code execution or system crashes, potentially violating integrity and availability requirements in GDPR and HIPAA. The high impact on integrity and availability (CVSS 6.1) suggests it may require remediation to maintain compliance with these standards.

Mitigation Strategies

Upgrade Zephyr RTOS to version 4.4.2 or later to apply the patch. If upgrading is not immediately possible, ensure untrusted virtio devices are not used in bare-metal or confidential computing environments. Avoid using passthrough virtio PCIe devices from untrusted sources.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-13216. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart