Categories: HackingSecurity

ASUS router firmware affected by root command execution flaw

Several ASUS routers include a service that listens on UDP broadcast port 9999 on the LAN interface and contains an unauthenticated command execution flaw.

The Security researchers Joshua Drake discovered a serious vulnerability in the firmware running on several ASUS routers that allows an unauthenticated attacker to run arbitrary command on the device. According to the expert, the security vulnerability may affect all current versions of the ASUS router firmware, Drake posted an advisory on the flaw that include details on the flaw. Vulnerable devices include RT-AC66U, RT-N66U, and many others.

The security researcher analyzed in the post the flaw and discovered that the problem resides in the infosvr service, which is used to help the administrators find and configure ASUS routers on a network segment.

“Several models of ASUS’s routers include a service called infosvr that listens on UDP broadcast port 9999 on the LAN interface. It’s used by one of ASUS’s tools to ease router configuration by automatically locating routers on the local subnet. This service runs with root privileges and contains an unauthenticated command execution vulnerability. The source code for this service, as well as the rest of the router, is available from ASUS’s Support Site.” reads the description for the flaw provided by Drake on Github.

The expert speculate that vulnerability resides in a block of code that is related to the processPacket function, which invoked after receiving a packet of INFO_PDU_LENGTH (512) bytes.

The following block contains what is believed to be the root cause of this vulnerability.

“The block starts off by excluding a couple of OpCode values, which presumably do not require authentication by design. Then, it calls the memcpy and suspiciously checks the return value against zero. This is highly indicative that the author intended to use memcmp instead. That said, even if this check was implemented properly, knowing the device’s MAC address is hardly sufficient authentication,” said Drake.

Drake recommends to remove the remote command execution function from the vulnerable service to protect the routers.

“Remove the remote command execution functionality from this service. Even if it were guarded with strong authentication, broadcasting a password to the entire LAN isn’t really something to be desired. If command execution is truly desired it should be provided via SSH or similar secure mechanism.”Drake wrote in his advisory.

David Longenecker recommends the use of a script (JFFS) in combination with the script_usbmount nvram setting to kill the infosvr process on the boot of the ASUS router. Another precious suggestion is provided by Eric Sauvageau (@RMerl) that suggests firewalling port 9999 off.

Another possibility is to disable the infosvr service by killing the process after each boot.

For extra fun/irony, use the exploit to do this:

$ ./asus-cmd "killall -9 infosvr"
[...]

The CVE assigned to this vulnerability in the ASUS router firmware the code CVE-2014-9583.

Pierluigi Paganini

(Security Affairs –  ASUS Router firmware, CVE-2014-9583)

Pierluigi Paganini

Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer. Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines. Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.

Recent Posts

SECURITY AFFAIRS MALWARE NEWSLETTER ROUND 45

Security Affairs Malware newsletter includes a collection of the best articles and research on malware…

5 hours ago

Security Affairs newsletter Round 524 by Pierluigi Paganini – INTERNATIONAL EDITION

A new round of the weekly SecurityAffairs newsletter arrived! Every week the best security articles…

6 hours ago

Experts found rogue devices, including hidden cellular radios, in Chinese-made power inverters used worldwide

Chinese "kill switches" found in Chinese-made power inverters in US solar farm equipment that could…

8 hours ago

US Government officials targeted with texts and AI-generated deepfake voice messages impersonating senior U.S. officials

FBI warns ex-officials are targeted with deepfake texts and AI voice messages impersonating senior U.S.…

1 day ago

Shields up US retailers. Scattered Spider threat actors can target them

Google warns that the cybercrime group Scattered Spider behind UK retailer attacks is now targeting…

1 day ago

U.S. CISA adds Google Chromium, DrayTek routers, and SAP NetWeaver flaws to its Known Exploited Vulnerabilities catalog<gwmw style="display:none;"></gwmw>

U.S. Cybersecurity and Infrastructure Security Agency (CISA) adds Google Chromium, DrayTek routers, and SAP NetWeaver…

1 day ago