CVE-2026-5066 net: sockets: tls: Potential out-of-bounds write/read in socket_op_vtable::connect function
An out-of-bounds write in Zephyr's TLS socket connect path allows attackers to cause crashes or execute arbitrary code when the TLS session cache is enabled.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-5066?
CVE-2026-5066 is a medium-severity memory corruption vulnerability in Zephyrproject Zephyr, published on 4 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
A potential out-of-bounds write/read exists in the TLS socket connect path of the network sockets subsystem (subsys/net/lib/sockets/sockets_tls.c). When the TLS session cache is enabled, tls_session_store() and tls_session_restore() memcpy the caller-supplied address into a fixed-size buffer using the caller-controlled addrlen value without validating it against the destination size. struct net_sockaddr is an opaque type, so an application can pass an addrlen larger than sizeof(struct net_sockaddr) (for example 128 bytes into a 24-byte stack buffer), causing the memcpy to read and write past the end of the address memory used by the TLS session cache. This out-of-bounds write can lead to a crash and denial of service, and potentially to arbitrary code execution.
Weakness: CWE-787
Which versions are affected by CVE-2026-5066?
It affects 1 product.
Products include Zephyrproject Zephyr.
How do I fix CVE-2026-5066?
No fix has been published for CVE-2026-5066 yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2026-5066 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-5066 exists.
Other vulnerabilities in Zephyrproject Zephyr
- CVE-2026-5067 Out-of-bounds read/write in HTTP WebSocket upgrade via non-null-terminated Sec-WebSocket-Key
- CVE-2022-3806 Bluetooth HCI Error Handling Double Free
- CVE-2017-14199 Memory corruption in getaddrinfo
- CVE-2018-1000800 Null dereference in n/a
- CVE-2021-3329 DOS: Incorrect handling of the initial HCI ACL_MTU handshake packet leads to crash of bluetooth host layer
Sources
Also known as GHSA-wgrc-jrf6-24f3.