Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2021-35393

CVE-2021-35393: Realtek Jungle SDK RCE Vulnerability

CVE-2021-35393 is a remote code execution vulnerability in Realtek Jungle SDK affecting the WiFi Simple Config server. Attackers can exploit a stack buffer overflow to execute arbitrary code. This article covers technical details.

Published:

CVE-2021-35393 Overview

CVE-2021-35393 is a critical stack buffer overflow vulnerability affecting Realtek Jungle SDK versions v2.x through v3.4.14B. The vulnerability exists in the 'WiFi Simple Config' server component, which implements both UPnP and SSDP protocols. This binary is typically named wscd or mini_upnpd and serves as the successor to miniigd. The flaw enables remote unauthenticated attackers to achieve arbitrary code execution on affected devices through maliciously crafted network requests.

Critical Impact

Remote unauthenticated attackers can exploit unsafe parsing of UPnP SUBSCRIBE/UNSUBSCRIBE Callback headers to execute arbitrary code on vulnerable IoT devices, potentially leading to complete device compromise and network infiltration.

Affected Products

  • Realtek RTL819x Jungle Software Development Kit v2.x
  • Realtek RTL819x Jungle Software Development Kit versions up to v3.4.14B
  • IoT devices and routers built on the affected Realtek SDK

Discovery Timeline

  • August 16, 2021 - CVE-2021-35393 published to NVD
  • August 13, 2025 - Last updated in NVD database

Technical Details for CVE-2021-35393

Vulnerability Analysis

This vulnerability is classified as CWE-787 (Out-of-bounds Write), specifically manifesting as a stack buffer overflow condition. The flaw resides in the WiFi Simple Config server's handling of UPnP protocol messages. When the server processes SUBSCRIBE or UNSUBSCRIBE requests, it fails to properly validate the length of the Callback header before copying its contents to a stack-based buffer. This memory corruption vulnerability is particularly dangerous in embedded IoT devices where security mitigations such as ASLR and stack canaries may be absent or weakly implemented.

The network-accessible nature of this vulnerability, combined with no authentication requirements, makes it an attractive target for automated exploitation at scale. Devices running the vulnerable SDK are typically exposed on local networks and, in some configurations, may be accessible from the internet.

Root Cause

The root cause is improper input validation and unsafe memory handling in the UPnP SUBSCRIBE/UNSUBSCRIBE Callback header parsing routine within wscd or mini_upnpd. The code fails to perform adequate bounds checking before copying user-controlled data from the Callback header into a fixed-size stack buffer. When an attacker supplies a Callback header value exceeding the allocated buffer size, the overflow corrupts adjacent stack memory, potentially overwriting the return address and enabling control flow hijacking.

Attack Vector

The attack vector is network-based, requiring no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Sending a crafted UPnP SUBSCRIBE or UNSUBSCRIBE request to the target device
  2. Including a malicious Callback header with payload data exceeding buffer boundaries
  3. Overflowing the stack buffer to overwrite the return address
  4. Redirecting execution to attacker-controlled shellcode or ROP chain

The vulnerability can be exploited by any attacker with network access to the UPnP service, typically running on ports 1900 (SSDP) or 52881 (UPnP). Given the prevalence of Realtek SDKs in consumer routers and IoT devices, this creates a significant attack surface across millions of deployed devices.

Detection Methods for CVE-2021-35393

Indicators of Compromise

  • Unusual network traffic to UPnP ports (1900/UDP, 52881/TCP) with abnormally large Callback headers
  • Unexpected crashes or restarts of wscd or mini_upnpd processes
  • Signs of unauthorized access or configuration changes on affected devices
  • Presence of unknown binaries or persistence mechanisms on compromised devices

Detection Strategies

  • Deploy network intrusion detection rules to identify malformed UPnP SUBSCRIBE/UNSUBSCRIBE requests with oversized Callback headers
  • Monitor for anomalous process behavior on embedded devices, including unexpected child process spawning from wscd or mini_upnpd
  • Implement deep packet inspection at network boundaries to detect exploitation attempts targeting UPnP services

Monitoring Recommendations

  • Enable logging on network devices to capture UPnP traffic patterns for forensic analysis
  • Conduct regular firmware inventory assessments to identify devices running vulnerable Realtek SDK versions
  • Monitor outbound connections from IoT devices for potential command-and-control communication following compromise

How to Mitigate CVE-2021-35393

Immediate Actions Required

  • Identify all devices in your environment using Realtek Jungle SDK versions v2.x through v3.4.14B
  • Disable UPnP services on affected devices if not required for operation
  • Segment IoT devices onto isolated network VLANs with restricted access
  • Block external access to UPnP ports (1900/UDP, 52881/TCP) at the network perimeter

Patch Information

Realtek has released security advisories addressing this vulnerability. Affected organizations should consult the Realtek SDK Security Advisory for official patch information. Device manufacturers using the affected SDK should integrate the patched SDK version and release firmware updates for their products. End users should check with their device vendors for available firmware updates.

Additional technical details can be found in the IoT Inspector Security Advisory.

Workarounds

  • Disable UPnP functionality entirely on affected devices where feasible
  • Implement firewall rules to restrict access to UPnP services to trusted internal hosts only
  • Deploy network segmentation to isolate vulnerable IoT devices from critical network assets
  • Consider replacing end-of-life devices that will not receive vendor patches
bash
# Example firewall rules to block UPnP access (adjust for your environment)
# Block SSDP discovery traffic
iptables -A INPUT -p udp --dport 1900 -j DROP

# Block UPnP HTTP traffic
iptables -A INPUT -p tcp --dport 52881 -j DROP

# Allow only from trusted management subnet (example)
iptables -I INPUT -s 192.168.1.0/24 -p udp --dport 1900 -j ACCEPT

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.