CVE-2026-95821: Zephyr SOCKS5 client use-after-free in stack callbacks

CVE-2026-95821 · Severity: medium · CVSS 6.5 · Published 2026-11-29

The Zephyr RTOS SOCKS5 networking client leaves dangling pointers to stack variables in callback handlers when connection errors occur. A remote attacker posing as a SOCKS5 proxy can trigger these errors and cause the networking stack to write data to freed stack memory asynchronously, potentially corrupting application state or crashing the device.

Technologies: Zephyr Project Zephyr RTOS. Vendors: Zephyr Project.

Quick answers

Is CVE-2026-95821 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-95821 being exploited in the wild.
How severe is CVE-2026-95821?
Medium severity, with a CVSS score of 6.5, published 29 November 2026.
Which products and versions are affected?
Zephyr Project Zephyr RTOS versions with CONFIG_SOCKS enabled.
Is there a fix for CVE-2026-95821?
Yes: fixed in Zephyr versions with the error path callback uninstall fix applied. Until then: Disable CONFIG_SOCKS or avoid configuring SOCKS5 proxies on network sockets until a patched version is deployed. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-95821 attacked?
It is attacked over the network, in an operating system.
Am I affected by CVE-2026-95821?
Check whether you run Zephyr Project Zephyr RTOS at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: Zephyr versions with the error path callback uninstall fix applied

Disable CONFIG_SOCKS or avoid configuring SOCKS5 proxies on network sockets until a patched version is deployed.

Technical details

The socks5_tcp_connect() function passes addresses of stack variables (method_rsp and cmd_rsp) to net_context_recv() as user data for callbacks, but fails to uninstall these callbacks on error paths. When a SOCKS5 proxy returns errors (method rejection, bad version, non-success CONNECT reply, or timeout), the callbacks remain registered but reference destroyed stack memory. Remote-triggered callback execution via tcp_conn_close() or net_context_packet_received() causes writes to stale stack addresses, resulting in memory corruption or crashes; the write address cannot be controlled by an attacker, limiting exploitability.

Affected products

  • Zephyr Project Zephyr RTOS versions with CONFIG_SOCKS enabled

Timeline

  • 2026-11-29: disclosed

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.