Trustwave SpiderLabs Security Advisory TWSL2018-002: Vulnerabilities in NETGEAR R8500 router firmware Published: 02/07/2018 Version: 1.0 Vendor: NETGEAR (www.netgear.com) Product: NETGEAR R8500 router (firmware) Version affected: 1.0.2.86_1.0.75, possibly earlier too Product description: NETGEAR R8500 router is a complex piece of hardware and software which provides functions such as remote management via web interface, USB storage support and many others. Finding 1: Accessing router's built-in webserver documents via the genie_restoring.cgi resource by unauthenticated users Nighthawk X8 as well as many other models ships with a built-in webserver used amoung other things for web management of the device. It is enabled by default to all LAN users (i.e. connected through WiFi using non-guest network or connected via a wire). If Remote Management is enabled (non-default setting) then web management is available to anyone on the Internet too. The built-in webserver exposes one specific resource (genie_restoring.cgi) which is available without prior authentication. The genie_restoring.cgi reads, processes as a template and returns to the caller any given file under the webserver document root. Many files under the document root are templates that contain references to sensetive information from NVRAM like router's administrator username and password for example. This makes it trivial to completely compromise the router using a sequence of steps outlined below. Suppose we are connected to the router via WiFi or a wired connection and the router's IP address is 192.168.1.1. Run the following command to get current CSRF token's value which is exposed in many places to unauthenticated users: curl http://192.168.1.1/MNU_top.htm | grep "id=" The output will look similar to: