Horizon Security discovered a command injection that lead to remote code execution in Fastweb’s FastGate router.
The vulnerability lies in the “status.cgi” executable, an ARM binary exposed through the webserver that handles all requests coming from the web application designed to manage the router’s settings. In particular, the request that validates the credentials for authentication to access the management interface does not filter user’s parameter and it’s possible to perform command injection via the password field. The vulnerability has been exploited to obtain an interactive shell with root privileges.
Another vulnerability has been identified on the CGI vulnerable binary: even if the web application provides some graphic interface that handles username and password, the binary does not authenticate all successive requests and it is possible to just query the binary to control the router and its configurations.
The remote code execution vulnerability was fixed by Fastweb with a firmware update, all firmware version up to 0.00.47_FW_200_Askey 2017-05-17 (with software version up to 1.0.1b) are vulnerable.
Vulnerability discovered by Alessio Santoru, Horizon Offensive Security Team.

