CVE-2026-8718: Out-of-bounds write in DTLS peer Connection ID getsockopt (`TLS_DTLS_PEER_CID_VALUE`) in Zephyr net sockets/TLS

Published Aug 10, 2026
·
Updated

tlsoptdtlspeerconnectionidvalueget() in subsys/net/lib/sockets/socketstls.c, which handles getsockopt(SOLTLS, TLSDTLSPEERCIDVALUE), passed the caller-supplied optval directly to mbedtlssslgetpeercid() without verifying the buffer was at least MBEDTLSSSLCIDOUTLENMAX (default 32) bytes. mbedtlssslgetpeercid() copies the peer-negotiated DTLS Connection ID (length 1..MBEDTLSSSLCIDOUTLENMAX) 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 CONFIGUSERSPACE builds the getsockopt syscall verifier (zvrfyzsockgetsockopt) bounce-buffers the user's optval into a kernel allocation of exactly optlen bytes (kusermodeallocfromcopy -> zthreadmalloc), 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 CONFIGMBEDTLSSSLDTLSCONNECTIONID, an established DTLS session with a negotiated peer CID, and (for the kernel-crossing case) CONFIGUSERSPACE. Introduced when the TLSDTLSCID option was added (v3.5.0).

The fix rejects callers whose optlen is below MBEDTLSSSLCIDOUTLENMAX with -EINVAL.

Affected Software

2 affected components
Zephyr net sockets/TLS>=3.5.0<=3.5.0
Zephyr net sockets/TLS>=undefined

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Zephyr net sockets/TLS / getsockopt(TLS_DTLS_PEER_CID_VALUE) + mbedtls_ssl_get_peer_cid() caller validation to a version that resolves this vulnerability.

    Fixed in v3.5.0
  2. Configuration

    Disable CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID to avoid the DTLS peer Connection ID getsockopt path (TLS_DTLS_PEER_CID_VALUE) being reachable when an established DTLS session with a negotiated peer CID exists.

    Zephyr net sockets/TLS CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID = disabled (not enabled)
  3. Configuration

    If applicable, disable CONFIG_USERSPACE builds to avoid the kernel-crossing bounce-buffer path (k_usermode_alloc_from_copy -> z_thread_malloc) that can induce a kernel-heap buffer overflow for getsockopt on DTLS sockets with Connection ID enabled.

    Zephyr CONFIG_USERSPACE builds (userspace syscall verifier z_vrfy_zsock_getsockopt) CONFIG_USERSPACE = disabled (not enabled)

Event History

Aug 10, 2026
CVE Published
via MITRE·10:40 PM
Data Sourced
via MITRE·10:40 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2026-8718 - Out-of-bounds write in DTLS peer Connection ID getsockopt (`TLS_DTLS_PEER_CID_VALUE`) in Zephyr net sockets/TLS - SecAlerts