DD-WRT UPnP Stack-Based Buffer Overflow Vulnerability
First seen Jul 22, 2026 · Updated Jul 22, 2026 · CVSS 9.8
DD-WRT firmware contains a stack-based buffer overflow in its UPnP handling that allows unauthenticated remote attackers to execute arbitrary code. The vulnerability has been added to CISA's Known Exploited Vulnerabilities catalog, indicating active exploitation in the wild. Organizations running DD-WRT on routers or edge devices should patch immediately given the short remediation window.
Technical Analysis
CVE-2021-27137 is a stack-based buffer overflow in DD-WRT's UPnP implementation that arises from insufficient bounds checking on attacker-controlled input processed by the UPnP daemon. An unauthenticated attacker on the local network, or in some misconfigured deployments the WAN interface, can send a crafted UPnP request to overflow the stack buffer and hijack control flow to achieve arbitrary code execution with router-level privileges. Successful exploitation can lead to full device takeover, enabling persistent implants, traffic interception, and pivoting into internal networks. Given its inclusion in the CISA KEV catalog, this flaw is confirmed to be actively exploited, likely as part of botnet recruitment or initial access campaigns targeting exposed embedded devices. If an organization runs AI agent infrastructure, edge inference gateways, or RAG pipeline components behind a DD-WRT router, compromise of the router could allow attackers to intercept API keys, model endpoints, and inter-service traffic used by those agents, or use the router as a foothold to attack agent hosts on the internal network.
Affected Systems
DD-WRT firmware builds with vulnerable UPnP daemon implementations; consumer and SOHO routers, VPN gateways, and embedded devices running affected DD-WRT versions with UPnP enabled.
Indicators of Compromise
- No specific IOCs published; monitor for anomalous UPnP traffic on port 1900/UDP and 5000/TCP; unexpected outbound connections from router management interfaces; unusual crash logs in UPnP daemon (upnp/miniupnpd) processes.
Remediation Steps
- 1
Apply firmware update
Update DD-WRT to the latest firmware version that patches CVE-2021-27137 as soon as it is available from the vendor or build repository.
- 2
Disable UPnP
Disable UPnP on all DD-WRT devices where the feature is not strictly required to eliminate the attack surface.
- 3
Restrict management interfaces
Ensure router administration and UPnP services are not exposed to the WAN/internet and are restricted to trusted internal networks only.
- 4
Network segmentation
Segment IoT and edge networking devices from critical infrastructure, including hosts running AI agents, LLM services, or RAG pipelines, to limit lateral movement if a router is compromised.
- 5
Monitor and audit
Review router logs for signs of compromise, unexpected firmware changes, or unauthorized configuration modifications, and rotate any credentials or API keys that may have transited the affected network.
CVE / Advisory IDs
Industries Most Exposed
Respond to this threat
Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.