CVE-2026-10643: Out-of-bounds heap write in Zephyr `recvmsg()` ancillary-data path (`insert_pktinfo` undersizes the control-buffer capacity check)

Published Jun 27, 2026
·
Updated

Zephyr's IP socket recvmsg() implementation (subsys/net/lib/sockets/socketsinet.c, insertpktinfo()) validated the user-supplied ancillary (msgcontrol) buffer using only the payload length (msg->msgcontrollen < pktinfolen) before writing a full control message consisting of an aligned cmsg header plus the payload. Because the check omitted the cmsg header size, a control buffer whose length falls in the under-checked window (e.g. 16-27 bytes for IPv4 IPPKTINFO on a 64-bit target, where a single element actually occupies 28 bytes) passes the guard yet causes a fixed-size out-of-bounds write of up to one cmsg header (~12 bytes) past the end of the buffer.

Under CONFIGUSERSPACE the recvmsg verifier allocates a kernel-heap copy of the control buffer sized to msgcontrollen and runs the implementation against it, so the overflow corrupts kernel heap memory and is triggerable from an unprivileged userspace thread; in supervisor mode it corrupts the caller's buffer.

The path is reachable on a UDP/IP socket with IPPKTINFO/IPV6RECVPKTINFO (or hoplimit/timestamping) enabled when the application calls recvmsg() with an undersized control buffer and a datagram is received; part of the overwritten bytes (the destination IP in ipiaddr) is influenced by the received packet.

The fix makes the capacity check use NETCMSGSPACE(pktinfolen) (aligned header + aligned data) and returns -ENOMEM when the buffer is too small. Affected: v3.6.0 through v4.4.0.

Affected Software

2 affected components
Zephyr Project Zephyr>=3.6.0<=4.4.0
zephyrproject zephyr>=3.6.0<=4.4.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Zephyr to a version that resolves this vulnerability.

    Fixed in v4.4.0
  2. Configuration

    In insert_pktinfo(), update the msg_controllen/msg->msg_controllen validation to use NET_CMSG_SPACE(pktinfo_len) so the code does not write a full cmsg header (~12 bytes) plus payload past the end of the control buffer; if the buffer is too small, return -ENOMEM.

    Zephyr recvmsg ancillary-data path (subsys/net/lib/sockets/sockets_inet.c, insert_pktinfo()) control-buffer capacity check = Use NET_CMSG_SPACE(pktinfo_len) (aligned cmsg header + aligned data) instead of checking only payload length
  3. Compensating control

    Restrict exposure by ensuring unprivileged userspace threads cannot call recvmsg() on UDP/IP sockets with IP_PKTINFO/IPV6_RECVPKTINFO (or hoplimit/timestamping) enabled using an undersized control buffer.

Event History

Jun 27, 2026
CVE Published
via MITRE·10:59 PM
Data Sourced
via MITRE·10:59 PM
DescriptionSeverityWeakness
Jun 28, 2026
Data Sourced
via NVD·12:16 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-10643?

CVE-2026-10643 has a severity rating of high at 8.7.

2

How do I fix CVE-2026-10643?

To fix CVE-2026-10643, you should update to the latest version of Zephyr Project that addresses this vulnerability.

3

What is the impact of CVE-2026-10643?

CVE-2026-10643 can potentially allow an attacker to execute arbitrary code due to an out-of-bounds heap write.

4

Which software is affected by CVE-2026-10643?

CVE-2026-10643 affects the Zephyr Project's implementation of IP sockets, specifically the recvmsg() function.

5

When was CVE-2026-10643 published?

CVE-2026-10643 was published on June 27, 2026.

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