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

Source: https://junglewise.ai/threats/cve-2026-95821-the-socks5-client-in-subsys-net-lib-socks-socks-c-passes-the  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-29. Updated: 2026-11-29  
License: CC BY 4.0 with a link back

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](https://junglewise.ai/threats/technologies/zephyr). Vendors: [Zephyr Project](https://junglewise.ai/threats/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

## Related threats

- [Zephyr USB device_next NULL pointer dereference in control handlers](https://junglewise.ai/threats/cve-2026-104931-since-the-control-transfer-rework-in-the-device-next-usb-device)
- [Zephyr STM32 Ethernet driver denial of service after packet drop](https://junglewise.ai/threats/cve-2026-104930-the-stm32-ethernet-driver-built-with-config-eth-stm32-hal-api-v2)
- [Zephyr RTOS use-after-free in IPv6 packet handling](https://junglewise.ai/threats/cve-2026-104379-net-if-try-send-data-in-subsys-net-ip-net-if-c-reads-net-pkt)
- [Zephyr kernel object core framework use-after-free memory corruption](https://junglewise.ai/threats/cve-2026-104376-the-kernel-object-core-framework-kernel-obj-core-c-linked-every)
- [Zephyr IPv4/IPv6/6LoWPAN fragment reassembly race condition](https://junglewise.ai/threats/cve-2026-102961-zephyr-s-ipv6-ipv4-and-ieee-802-15-4-6lowpan-fragment-reassembly)
