Skip to content
FlawDB
Sign in

CVE-2026-95821

MEDIUM 6.5EPSS 42%

Dangling stack pointer left installed as TCP receive callback after a failed SOCKS5 handshake

AI summary AI generated

A malicious SOCKS5 proxy can make Zephyr's SOCKS5 client leave a dangling stack pointer as a TCP receive callback, letting it corrupt the connecting thread's stack or crash the device.

Mitigation

  • Upgrade zephyr to 4.5.0 or later.

Who should check

  • Anyone running zephyrproject zephyr >= 2.0.0, < 4.3.2; >= 4.4.0, < 4.5.0

Vulnerability facts

Affected
zephyrproject zephyr >= 2.0.0, < 4.3.2; >= 4.4.0, < 4.5.0
Fixed in
zephyrproject zephyr 4.3.2, zephyrproject zephyr 4.5.0
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
6.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:LOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: None
  • Integrity impact: Low
  • Availability impact: Low
EPSS
0.46% chance of exploitation in 30 days (percentile 42, 2026-12-01)
CWE
CWE-825
Published
Modified

Description

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.

Affected and fixed versions

Package / productAffectedFixedSource
zephyrproject zephyr>= 2.0.0, < 4.3.2; >= 4.4.0, < 4.5.0—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-95821. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-95821.md
Affected: zephyrproject zephyr >= 2.0.0, < 4.3.2; >= 4.4.0, < 4.5.0
Fixed in: zephyrproject zephyr 4.3.2, zephyrproject zephyr 4.5.0

Steps:
1. Search this machine and project for zephyrproject zephyr: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

Technologies

References

FAQ

Is CVE-2026-95821 being exploited?

There is no confirmed exploitation: CVE-2026-95821 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.46% chance of exploitation in the next 30 days (as of 2026-12-01).

How serious is CVE-2026-95821?

Medium: CVSS 6.5 (v3.1, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2026-95821?

zephyrproject zephyr >= 2.0.0, < 4.3.2; >= 4.4.0, < 4.5.0.

Is there a fix for CVE-2026-95821?

Yes. Fixed in zephyrproject zephyr 4.3.2, zephyrproject zephyr 4.5.0. Upgrade zephyr to 4.5.0 or later.

How do I check if I'm affected by CVE-2026-95821?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

See all
Vulnerabilities, newest first
SeverityIdentifier / vulnerabilityTechnologySignalsAge
MEDIUM 5.5CVE-2026-105418

NULL pointer dereference in SocketCAN getsockopt/setsockopt on an unbound socket

Zephyr RTOS
MEDIUM 5.4CVE-2026-125037

Zephyr Project Manager <= 3.3.210 - Authenticated (Subscriber+) Stored DOM-Based Cross-Site Scripting via 'attachments[0][attachment_id]' Parameter

WordPress+2
MEDIUM 4.4CVE-2026-105417

Memory domain partition removal does not revoke user-thread access on ARMv8-R AArch64 MPU

Zephyr RTOS
MEDIUM 6.1CVE-2026-86086

Unvalidated userspace pointer dereference in zsock_getsockopt syscall verifier allows limited kernel memory disclosure and system halt

Zephyr RTOS
MEDIUM 4.2CVE-2026-105416

UART RX interrupt storm denial of service in ESP32 serial driver async API

Zephyr RTOS
Sponsors