Netgear has released  round of patches to remediate a high security remote code execution vulnerability affecting multiple routers that could be exploited by remote attackers to take control of an affected system.

Tracked as CVE-2021-34991 (CVSS score: 8.8), the pre authentication buffer overflow flaw in routers can lead to code execution with the highest privileges by taking advantage of an issue residing in the Universal Plug and Play (UPnP) feature that allows devices to discover each other’s presence on the same local network and open ports needed to connect to the public Internet.

Advertisements

UPnP is used by a wide variety of devices, including personal computers, networking equipment, video game consoles and IoT devices.

The vulnerability stems from the fact that the UPnP daemon accepts unauthenticated HTTP SUBSCRIBE and UNSUBSCRIBE requests which are event notification alerts that devices use to receive notifications from other devices when certain configuration changes, such as media sharing, happen.

There exists a memory stack overflow bug in the code that handles the UNSUBSCRIBE requests, which enables an adversary to send a specially crafted HTTP request and run malicious code on the affected device, including resetting the administrator password and delivering arbitrary payloads. Once the password has been reset, the attacker can then login to the webserver and modify any settings or launch further attacks on the webserver.

“Since the UPnP daemon runs as root, the highest privileged user in Linux environments, the code executed on behalf of the attacker will be run as root as well,With root access on a device, an attacker can read and modify all traffic that is passed through the device.”

Advertisements

This is far from the first time vulnerable implementations of UPnP have been uncovered in networked devices.