Root via DDNS: The Multi-Stage Exploit Dissecting the TP-Link Omada ER605
A critical vulnerability chain has been unearthed within the TP-Link Omada ER605 router, facilitating unauthenticated remote code execution. A meticulous deconstruction of the attack mechanics and a functional exploit reproduction were published by an independent researcher, who scrutinized the internal Dynamic DNS (DDNS) service employed by the device for network record synchronization.
The flaw compromises TP-Link ER605 VPN routers running firmware versions prior to ER605(UN)_V2_2.2.4. At the epicenter of the assault lies the cmxddnsd daemon—the process governing DDNS operations. Executed with elevated privileges, this daemon processes responses from Dynamic DNS servers. Forensic analysis revealed that the handling of network packets is fraught with inadequate field-length validation, precipitating a buffer overflow and the subsequent hijacking of execution flow.
The exploit is architected by amalgamating three distinct vulnerabilities: CVE-2024-5242, CVE-2024-5243, and CVE-2024-5244. The primary vulnerability involves the spoofing of administrative DDNS messages by exploiting a clandestine encoding implementation and a hardcoded cryptographic key. The secondary and tertiary flaws enable a buffer overflow during the parsing of server monikers and error codes within DDNS responses. These deficiencies are localized within a singular function dedicated to ingress packet analysis.
The manufacturer’s DDNS protocol utilizes a proprietary encoding scheme and a modified Base64 alphabet in conjunction with DES encryption, the key for which is embedded directly within the binary. Through reverse engineering of the algorithm, it became feasible to construct syntactically valid server responses, thereby coercing the router into a specific, compromised processing trajectory.
The exploitation unfolds in two distinct phases. Initially, the adversary orchestrates a memory leak by overflowing global structures via a meticulously malformed, oversized DNS query, thereby circumventing Address Space Layout Randomization (ASLR). Subsequently, a stack overflow is triggered within the ErrorCode field, allowing the return address to be overwritten and a Return-Oriented Programming (ROP) chain to be forged to execute arbitrary system commands.
Successful execution necessitates a Man-in-the-Middle (MitM) position within the network traffic between the device and external DNS servers. In the documented scenario, a rogue DHCP server was employed to impersonate the gateway and DNS node. Consequently, all outbound traffic from the router is routed through the attacker’s node, granting the ability to intercept and manipulate DDNS service responses.
Ultimately, this allows for the execution of commands with root-level administrative privileges. Constraints on payload length are bypassed by fetching a secondary stage script from a remote server. The Proof-of-Concept (PoC) exploit has been released to the public domain by the researcher, and users are urged to update their firmware to the remediated version immediately.
Support Our Threat Intelligence
If you find our technology report and cybersecurity news helpful, consider supporting our work.