Zephyr RTOS
CVE-2026-8718
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain unprivileged thread execution on Zephyr device
-
DeliveryOpen or inherit DTLS socket with peer CID negotiated
-
ExploitCall getsockopt with optlen below 32 bytes
-
ExecutionSyscall verifier allocates undersized kernel heap buffer
-
Persistmbedtls_ssl_get_peer_cid() writes CID past buffer end
-
ImpactCorrupt adjacent kernel heap object for privilege escalation or denial of service
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Three conditions must all be satisfied simultaneously. First, the firmware must be compiled with CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y, which is not a default Kconfig option. Second, the attacking thread must have an established DTLS connection on which the remote peer has negotiated a Connection ID of at least 1 byte - meaning the remote endpoint must also support and enable DTLS CID. Third, for the kernel-heap overflow path (the highest-impact variant), CONFIG_USERSPACE=y must be enabled, which partitions the address space and routes getsockopt through the syscall verifier that performs the fatal undersized allocation. Without CONFIG_USERSPACE, the overflow still occurs but is confined to the process heap rather than the kernel allocator. Exploitation is further limited to threads that already have an open, connected DTLS socket file descriptor; network-remote attackers who have not already achieved local code execution cannot trigger this path directly. |
| Impact | The CVSS 3.1 vector (AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H, score 8.4) accurately reflects the attack conditions: local access with low privileges and no interaction required, crossing a privilege boundary into the kernel. The scope change (S:C) is well-justified because the overflow targets kernel-heap memory from a userspace thread. Real-world risk is meaningfully constrained by three stacked prerequisites: the DTLS Connection ID feature must be compiled in (CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID), an active DTLS session with a negotiated peer CID must exist, and CONFIG_USERSPACE must be enabled for the most impactful kernel-crossing path. These are non-default Kconfig options typically found only in purpose-built embedded networking firmware. EPSS data was not provided in the input, so exploitation probability cannot be quantified. No CISA KEV listing and no public POC lower the immediate urgency compared to the raw CVSS score. Teams operating embedded IoT gateways or mesh network nodes on Zephyr v3.5.0 and later with DTLS CID enabled should treat this as a priority patch, while projects not using DTLS CID can deprioritize. The overflow content is the remote peer's CID, limiting attacker control over what bytes are written beyond the buffer boundary. |
| Exploit ScenarioDerived | An attacker with code execution as an unprivileged user thread on a Zephyr device - for example, via a compromised application partition - establishes or reuses a DTLS session on a socket with Connection ID negotiated. The thread calls getsockopt(SOL_TLS, TLS_DTLS_PEER_CID_VALUE) with an optlen smaller than 32 bytes, causing the syscall verifier to allocate an undersized kernel heap buffer and mbedtls_ssl_get_peer_cid() to write the peer CID beyond the allocation boundary, potentially corrupting adjacent kernel heap objects. No public POC is available at time of analysis, so successful exploitation would currently require custom tooling and knowledge of the target's heap layout. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 10, 2026
Kernel-heap buffer overflow in Zephyr RTOS's DTLS socket layer allows a low-privileged user thread to write up to 31 bytes past an attacker-controlled heap allocation in the kernel. The root cause is that tls_opt_dtls_peer_connection_id_value_get() in subsys/net/lib/sockets/sockets_tls.c forwarded a caller-supplied optval buffer to mbedtls_ssl_get_peer_cid() without verifying the buffer was at least MBEDTLS_SSL_CID_OUT_LEN_MAX (32) bytes, while the syscall verifier in CONFIG_USERSPACE builds allocated exactly optlen bytes for the bounce buffer. No public exploit code has been identified at time of analysis, and this CVE is not listed in the CISA KEV catalog.
RemediationAI
Apply the upstream fix from commit aa317825a55a401315e8e17f620c70c02e8f176d (https://github.com/zephyrproject-rtos/zephyr/commit/aa317825a55a401315e8e17f620c70c02e8f176d), which adds a size guard rejecting any getsockopt call where optlen is below MBEDTLS_SSL_CID_OUT_LEN_MAX. A released tagged version incorporating this fix was not independently confirmed from the available input data - consult the Zephyr security advisory at https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-p3r6-mx6c-33gq for release version confirmation. If patching is not immediately possible, disable CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID in the project's Kconfig to remove the vulnerable code path entirely; the trade-off is loss of DTLS Connection ID support, which may affect session resumption in mobile DTLS deployments. Alternatively, if DTLS CID is required but CONFIG_USERSPACE is not, disabling CONFIG_USERSPACE removes the kernel-crossing overflow path, though the userspace-only heap corruption risk in non-syscall builds may remain depending on buffer layout.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Zephyr RTOS (CPE: cpe:2.3:a:zephyrproject:zephyr:*:*:*:*:*:*:*:*) is a small-footprint, real-time operating system for embedded and IoT devices, integrating mbedTLS for its TLS stack. The vulnerability (CWE-787: Out-of-bounds Write) resides in the getsockopt handler for SOL_TLS / TLS_DTLS_PEER_CID_VALUE. When CONFIG_USERSPACE is enabled, the syscall verifier z_vrfy_zsock_getsockopt uses k_usermode_alloc_from_copy and z_thread_malloc to allocate a kernel-side bounce buffer of exactly the caller-supplied optlen bytes. mbedtls_ssl_get_peer_cid() then copies the negotiated DTLS Connection ID - which can be 1 to MBEDTLS_SSL_CID_OUT_LEN_MAX (default 32) bytes - into that buffer without receiving a destination-size parameter, producing an unbounded write of up to 31 bytes beyond the allocation. The defect was introduced in Zephyr v3.5.0 when DTLS Connection ID support was added. The fix (commit aa317825a) inserts a size guard that returns -EINVAL when optlen is below MBEDTLS_SSL_CID_OUT_LEN_MAX before any copy is attempted.
Know when Zephyr gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H
Local vector confirmed by userspace-thread requirement; PR:L because an unprivileged thread suffices; S:C for kernel boundary crossing; C:N as only the CID bytes (not secrets) are written.
Primary rating from Vendor (zephyr).
CVSS VectorVendor: zephyr
DescriptionCVE.org
tls_opt_dtls_peer_connection_id_value_get() in subsys/net/lib/sockets/sockets_tls.c, which handles getsockopt(SOL_TLS, TLS_DTLS_PEER_CID_VALUE), passed the caller-supplied optval directly to mbedtls_ssl_get_peer_cid() without verifying the buffer was at least MBEDTLS_SSL_CID_OUT_LEN_MAX (default 32) bytes. mbedtls_ssl_get_peer_cid() copies the peer-negotiated DTLS Connection ID (length 1..MBEDTLS_SSL_CID_OUT_LEN_MAX) into that buffer without a destination-size parameter, so a caller-supplied optlen smaller than the CID causes a write of up to 31 bytes past the buffer end.
In CONFIG_USERSPACE builds the getsockopt syscall verifier (z_vrfy_zsock_getsockopt) bounce-buffers the user's optval into a kernel allocation of exactly optlen bytes (k_usermode_alloc_from_copy -> z_thread_malloc), so an unprivileged user thread that passes a small optlen on a connected DTLS socket with Connection ID enabled induces a kernel-heap buffer overflow, with the overflowing content being the remote peer's CID.
The defect requires CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID, an established DTLS session with a negotiated peer CID, and (for the kernel-crossing case) CONFIG_USERSPACE. Introduced when the TLS_DTLS_CID option was added (v3.5.0).
The fix rejects callers whose optlen is below MBEDTLS_SSL_CID_OUT_LEN_MAX with -EINVAL.
Executive ViewAI
A kernel-level vulnerability in Zephyr RTOS allows low-privileged local processes to gain system control and escalate privileges, creating risk for organizations running Zephyr-based IoT and embedded systems in production. Although no public exploit code has been identified, the vulnerability requires immediate patching to prevent attackers with local device access from compromising system integrity.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Affected Products (CPE)CVE.org
Potential off-by-one buffer overflow vulnerability in the Zephyr fuse file system. Rated critical severity (CVSS 10.0),
An out-of-bounds write in the Zephyr RTOS DNS resolver (dns_unpack_name()) lets a crafted DNS response corrupt memory on
Possible variant of CVE-2021-3434 in function le_ecred_reconf_req. Rated critical severity (CVSS 9.8), this vulnerabilit
Unchecked user input length in /subsys/net/l2/wifi/wifi_shell.c can cause buffer overflows. Rated critical severity (CVS
Potential buffer overflow vulnerability in the Zephyr CAN bus subsystem. Rated critical severity (CVSS 9.8), this vulner
Integer Underflow in 6LoWPAN IPHC Header Uncompression in Zephyr. Rated critical severity (CVSS 9.8), this vulnerability
Buffer overflow in Zephyr USB DFU DNLOAD. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable
DOS: Incorrect 802154 Frame Validation for Omitted Source / Dest Addresses. Rated critical severity (CVSS 9.8), this vul
zephyr-rtos version 1.12.0 contains a NULL base pointer reference vulnerability in sys_ring_buf_put(), sys_ring_buf_get(
Potential buffer overflow vulnerabilities n the Zephyr Bluetooth subsystem. Rated critical severity (CVSS 9.6), this vul
The documentation specifies that the BT_GATT_PERM_READ_LESC and BT_GATT_PERM_WRITE_LESC defines for a Bluetooth characte
Potential buffer overflows in the Bluetooth subsystem due to asserts being disabled in /subsys/bluetooth/host/hci_core.c
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB