Hacking

Critical RCE Bug Affects Millions of OpenWrt-based Network Devices

A security researcher disclosed technical details of a critical remote code execution flaw affecting the OpenWrt Linux-based operating system for network devices.

Earlier this year, security expert Guido Vranken from the software firm ForAllSecure, discovered a critical vulnerability in the OpenWrt Linux-based operating system for network devices.

The flaw tracked as CVE-2020-7982 is a critical remote code execution vulnerability affecting the operating system, which is a widely used Linux-based operating system for network devices such as routers and residential gateways.

The vulnerability exists in the OPKG package manager of OpenWrt, it is related to the way it performs integrity checking of downloaded packages using the SHA-256 checksums that are embedded in the signed repository index.

opgk is a utility to install or update the software on an OpenWRT system, it is comparable to apt on Debian-based systems.

The expert discovered that when an ‘ install’ command is executed on the target system, a remote attacker could exploit the vulnerability to intercept the communication of a targeted device to execute arbitrary code by tricking it into installing a malicious package or software update.

The successful exploitation of the flaw could allow a remote attacker to gain complete control over the vulnerable OpenWrt network device.

Vranken explained that when a checksum contains any leading spaces, the OPKG utility on the vulnerable versions of the operating system fails to check the integrity of the downloaded package and installs them.

“For exploitation it is required that the attacker serves (compromised) packages from a web server. The attacker must either be in a position to intercept and replace communication between the device and downloads.openwrt.org, or control the DNS server used by the device to make downloads.openwrt.org point to a web server controlled by the attacker.” reads a post published by the expert. “Attacks on a local network using packet spoofing or ARP cache poisoning might be possible, but this has not been tested.”

The expert ethically reported the flaw to the OpenWrt development team that acknowledged the flaw.

“Due to the fact that opkg on OpenWrt runs as root and has write access to the entire filesystem, arbitrary code could be injected by means of forged .ipk packages with a malicious payload,” states the OpenWrt team.

The vulnerability affects versions 18.06.0 to 18.06.6 and 19.07.0, as well as LEDE 17.01.0 to 17.01.7.

Vranken explained that to solve the issue, OpenWRT removed the space in the SHA256sum from the package list, but this solution is only partial remediation.

“As a stopgap solution, OpenWRT removed the space in the SHA256sum from the package list shortly after I reported the bug,” Vranken added. “However, this is not an adequate long-term solution because an attacker can simply provide an older package list that was signed by the OpenWRT maintainers.”

OpenWrt addresses the flaw with the release of the versions 18.06.7 and 19.07.1.

[adrotate banner=”9″] [adrotate banner=”12″]

Pierluigi Paganini

(SecurityAffairs – networking, hacking)

[adrotate banner=”5″]

[adrotate banner=”13″]

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…

4 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…

4 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…

7 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.…

23 hours 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