Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAct as configured/compromised SOCKS5 proxy
-
DeliveryReturn protocol-legal error or stall handshake
-
Exploitsocks5_tcp_connect returns leaving callbacks installed
-
ExecutionTCP FIN/RST/timeout or data dereferences dangling stack pointer
-
Impact2-4 byte write corrupts live frame or crashes thread
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Expired pointer prevention
|
| Exploitation Conditions | Exploitation requires a specific, non-default build and runtime configuration: CONFIG_SOCKS=y, Zephyr's BSD socket layer over native TCP, CONFIG_NET_CONTEXT_SYNC_RECV=y (default) and a finite CONFIG_NET_SOCKETS_CONNECT_TIMEOUT (default 3000 ms), AND the application must actively configure a SOCKS5 proxy on the socket via SO_SOCKS5 and connect() through it. The attacker must BE that configured SOCKS5 proxy (malicious or compromised) or an on-path actor able to inject a valid, sequence-correct response into the established TCP stream (the on-path case was not demonstrated and is harder). The trigger is any protocol-legal handshake failure (0xFF NO ACCEPTABLE METHODS, bad version byte, non-success REP) or simply stalling past the connect timeout, after which the caller-owned socket descriptor must remain open with no intervening receive registration - closing the socket promptly clears the stale callback and substantially narrows the window. Limiting factors: no effect without SOCKS5 proxy use, impact is bounded to a 2-4 byte write at a non-attacker-controlled stack address, and meaningful (non-crash) corruption depends on the connecting thread having reused that stack memory for a live frame. |
| Impact | This is a medium-severity (CVSS 6.5, AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L) dangling-stack-pointer flaw (CWE-825) in Zephyr's SOCKS5 client, and the real-world risk is materially lower than a network-reachable 6.5 might suggest. The decision label is 'this_month' (not act_now/emergency), it is NOT on CISA KEV, and no EPSS probability was supplied in the input, so there is no evidence of active or widespread exploitation. The write address is NOT attacker-controlled and the payload is only 2-4 bytes (zeroes on the teardown path, peer-chosen bytes on the data path), so by the vendor's own account the practical impact is limited corruption or a crash (the author observed a SEGV under CONFIG_ASAN) rather than a directed memory-write primitive - this is consistent with the C:N/I:L/A:L impact and the 'Denial Of Service' tag. The attack surface is also gated hard: only builds with CONFIG_SOCKS enabled AND a SOCKS5 proxy actually configured on the socket are affected, which is a small subset of Zephyr deployments. Note a tension between the CVSS metrics and the mechanism: AC:L reflects the trivially protocol-legal trigger, but the advisory states meaningful corruption depends on the connecting thread having reused the dead stack frame for a live frame - an uncontrolled timing/reuse condition - so reliable impact beyond a crash is uncertain. Treat this as a prioritized patch-this-month item for the narrow set of SOCKS5-enabled embedded deployments, not a drop-everything emergency. |
| Exploit ScenarioDerived | An application built with CONFIG_SOCKS and configured to reach the network through a SOCKS5 proxy (via SO_SOCKS5) calls connect(); an attacker who controls or has compromised that configured proxy - or an on-path attacker who can inject into the TCP stream - answers the handshake with a protocol-legal failure (e.g. NO ACCEPTABLE METHODS 0xFF, a bad version byte, a non-success REP) or simply stalls until the connect timeout. socks5_tcp_connect() then returns an error while leaving its stack-local response buffers installed as the TCP receive callback's user data; a later FIN/RST/timeout or a delayed data packet makes the networking threads write 2-4 bytes through that dead stack pointer. The reporter privately reproduced the two-byte method-response write under AddressSanitizer, but did not demonstrate code execution, a chosen victim object, or a crash on a non-instrumented target. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 29, 2026
A failed SOCKS5 handshake in Zephyr's SOCKS client (subsys/net/lib/socks/socks.c) leaves the TCP context holding a receive callback whose user-data pointer refers to stack variables (method_rsp, cmd_rsp) of socks5_tcp_connect() that no longer exist, so a malicious or compromised proxy can later cause a 2-4 byte write into a destroyed stack frame when the connection is torn down or further data arrives. Affected builds are Zephyr >= 2.0.0, < 4.3.2 and >= 4.4.0, < 4.5.0 that enable CONFIG_SOCKS and connect through a configured SOCKS5 proxy; the flaw is fixed in 4.3.2 and 4.5.0. Impact is bounded - the write address is not attacker-controlled and the build/runtime prerequisites are narrow, so the practical outcome is limited stack corruption or a crash rather than a directed write primitive; no public exploit code has been identified at time of analysis, though the reporter reproduced the two-byte method-response write under AddressSanitizer in a local test setup, and exploitation by an on-path injector was not demonstrated.
RemediationAI
Upgrade to Zephyr 4.3.2 or 4.5.0 (or a later release on those lines); the fix is commit 5bf0cb3eef2f9d5700d35df8e84a8cd52be47af7, which routes all error returns in socks5_tcp_connect() through a common error label that calls net_context_recv(ctx, NULL, K_NO_WAIT, NULL) to uninstall both the receive callback and the user-data pointer before the stack frame disappears. Release lines that have not taken the backport remain affected per the advisory range, so confirm the exact fixed tag for your branch against GHSA-jc9q-r4vv-8jjx. Where updating is not immediately possible, close the caller-owned socket descriptor promptly when connect() through the SOCKS5 proxy fails, since net_context_put() clears recv_cb before net_tcp_put() and the reporter's close-before-response control produced no sanitizer finding - but this only substantially narrows the window and is not a synchronized fix for an already in-flight callback. Treating the configured SOCKS5 proxy as trusted infrastructure and avoiding untrusted or on-path-reachable proxies reduces exposure, at the cost of assuming the proxy is never compromised, and networks using this stack should not be exposed to untrusted proxies until patched.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CWE-825 (expired pointer dereference) in Zephyr's native TCP SOCKS5 implementation. Since commit 39ed77e4387eb00ce3b799d2e24d46cb1af222f1 ("net: socks: Make SOCKS5 implementation transparent", August 2019, first released in v2.0.0) the handshake uses net_context_recv() callbacks instead of blocking socket receives. For a TCP context net_context_recv() reaches net_tcp_recv() in subsys/net/ip/tcp.c, which only stores context->recv_cb and conn->recv_user_data and never removes them; with CONFIG_NET_CONTEXT_SYNC_RECV enabled (default) the call blocks on recv_data_wait, and on timeout it returns -ETIMEDOUT without clearing that registration. The success path in zsock_connect_ctx() immediately re-installs zsock_received_cb(), but every post-recv failure in socks5_tcp_connect() was a bare return, so the context kept a pointer into a stack frame that had already been destroyed. Dereference happens asynchronously from the networking threads: tcp_conn_close() calls context->recv_cb() on FIN, RST or TCP timeout and the callback memset()s through the stale pointer, while net_context_packet_received() lets net_pkt_read() write peer-supplied bytes to the same location. The callbacks are only reached from these network-thread paths, because net_context_put() clears recv_cb before net_tcp_put(); SOCK_EOF is set only from the receive path, so the sock_is_eof() guard cannot skip the success-path re-installation during the handshake. The trigger is a protocol-legal proxy response - 0xFF NO ACCEPTABLE METHODS, a bad version byte, a non-success REP in the CONNECT reply, or a stall past CONFIG_NET_SOCKETS_CONNECT_TIMEOUT (default 3000 ms). The v1.14.x implementation (ead249f2f951) is not affected.
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:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
The malicious proxy is remote and needs no privileges on the target (AV:N/PR:N), triggering is a trivial protocol-legal response (AC:L); the write is non-controlled 2-4 bytes, giving limited integrity and availability impact and no confidentiality (C:N/I:L/A:L).
Primary rating from Vendor (zephyr).
CVSS VectorVendor: zephyr
DescriptionCVE.org
The SOCKS5 client in subsys/net/lib/socks/socks.c passes the addresses of two of socks5_tcp_connect()'s own stack variables, method_rsp and cmd_rsp, to net_context_recv() as the user data for the negotiation and CONNECT response callbacks. For a TCP context net_context_recv() reaches net_tcp_recv(), which only stores context->recv_cb and conn->recv_user_data and never removes them. On the success path zsock_connect_ctx() immediately replaces them with zsock_received_cb(), but on every error path nothing did, so the network context was left holding a pointer into a stack frame that had already been destroyed.
Any remote peer acting as the proxy can arm this with a protocol-legal response: answering the method negotiation with NO ACCEPTABLE METHODS (0xFF), sending a bad version byte, returning a non-success REP in the CONNECT reply, or simply stalling until CONFIG_NET_SOCKETS_CONNECT_TIMEOUT expires all make socks5_tcp_connect() return an error while the callbacks stay installed. The dangling pointer is then dereferenced asynchronously from the networking threads: tcp_conn_close() in subsys/net/ip/tcp.c invokes context->recv_cb() on FIN, RST or timeout, and the callback memset()s through the stale pointer, while any further data on the socket reaches net_context_packet_received() and makes net_pkt_read() write peer-supplied bytes there.
The result is a write of two to four bytes (zeroes on the teardown path, peer-chosen bytes on the data path) into a stack region of the thread that called connect(), at a moment when that thread may have reused the memory for a live frame. The write address is not attacker-controlled, so the practical impact is limited corruption or a crash rather than a directed memory-write primitive; the author observed it as a SEGV in tcp_conn_close() under CONFIG_ASAN. Only configurations with CONFIG_SOCKS enabled and a SOCKS5 proxy configured on the socket are affected.
The fix routes the error returns through a common exit that calls net_context_recv(ctx, NULL, K_NO_WAIT, NULL), uninstalling the callback and the user-data pointer before the stack frame goes away.
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
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
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
EUVD-2026-137829
NVD
CVE.org
EPSS
GitHub
Exploit-DB