Zephyrproject-rtos Zephyr
net: sockets: tls: Potential out-of-bounds write/read in socket_op_vtable::connect function
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 3.7.2
- >= 4.0.0, < 4.2.2
- >= 4.3.0, < 4.3.1
Fixed in 3.7.2, 4.2.2, 4.3.1
Mitigation
Upgrade Zephyr to 3.7.2 or 4.2.2 or 4.3.1 or later.
References
- Vendor advisory github.com/zephyrproject-rtos/zephyr/security/…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.