Expert released PoC exploit code for unpatched backdoor in HiSilicon chips

Researcher published details about a backdoor mechanism he found in HiSilicon chips, but he did not report it to the vendor due to the lack of trust in it.

The Russian security expert Vladislav Yarmak has published technical details about a backdoor mechanism he discovered in HiSilicon chips.

The backdoor mechanism could allow attackers to gain root shell access and full control of device. The expert also published a Proof of concept code for the vulnerability.

The expert did not disclose the flaw to HiSilicon due to the lack of trust in the vendor to address the issue.

HiSilicon is a Chinese fabless semiconductor company based in Shenzhen and owned by Huawei, it is the largest domestic designer of integrated circuits in China.

HiSilicon is the largest domestic designer of integrated circuits in China, its chips are used by millions of IoT devices worldwide, including security cameras, DVRs, and NVRs.

The presence of backdoor mechanisms in the HiSilicon chips was already documented by other experts in the past.

More recent versions of the devices had access enabled with a static root can be recovered from with (relatively) little computation effort.

More recent firmware versions had Telnet access and debug port (9527/tcp) disabled by default, but they had open port 9530/tcp that could be exploited by attackers to send a special command to start telnet daemon and enable shell access with a static password ([1], [2], [3]).

“Most recent firmware versions have open port 9530/tcp listening for special commands, but require cryptographic challenge-response authentication for them to be committed. This is a subject of actual disclosure.” reads the post publishe by Yarmak.

“Apparently, all these years HiSilicon was unwilling or incapable to provide adequate security fixes for same backdoor which, by the way, was implemented intentionally.”

Yarmak explained that it is possible to exploit the backdoor by sending a series of commands over TCP port 9530 to devices based on HiSilicon chips. The commands allow the attacker to enable the Telnet service on a flawed device, then the attacker could log in using one of the following six Telnet credentials, and gain access to a root account.

LoginPasswordrootxmhdipcrootklv123rootxc3511root123456rootjvbzdroot hi3518 Below the backdoor activation process described by the expert:

Client opens connection to port TCP port 9530 of device and sends string OpenTelnet:OpenOnce prepended with byte indicating total message length. This step is last for previous versions of backdoor. Probably telnetd was already started if there no response after this step.Server (device) anwers with string randNum:XXXXXXXX where XXXXXXXX is 8-digit random decimal number.Client uses it’s pre-shared key and constructs encryption key as concatenation of received random number and PSK.Client encrypts random number with encryption key and sends it after string randNum:. Entire message is prepended with byte indicating total length of message.Server loads same pre-shared key from file /mnt/custom/TelnetOEMPasswd or uses default key 2wj9fsa2 if file is missing.Server performs encryption of random number and verifies result is identical with string from client. On success server sends string verify:OK or verify:ERROR otherwise.Client encrypts string Telnet:OpenOnce, prepends it with total length byte, CMD: string and sends to server.Server extracts and decryptes received command. If decryption result is equal to string Telnet:OpenOnce it responds with Open:OK, enables debug port 9527 and starts telnet daemon.Yarmak pointed out that despite the presence of backdoor mechanism was reported by experts in the past, the vendor was not able to address them and only opted to disable the Telnet service.

The bad news for the users is that currently even if no patch is available for the backdoor, the expert decided to publish a proof-of-concept (PoC) code.

“Taking into account earlier bogus fixes for that vulnerability (backdoor, actually) it is not practical to expect security fixes for firmware from [the] vendor,” Yarmak concludes. “Owners of such devices should consider switching to alternatives.”

As mitigation, users are recommended to “completely restrict network access to these devices to trusted users.”

According to the expert, there are dozens of brands and hundreds of model vulnerable to hack, he referred to previous research conducted by another researcher that listed some of the vulnerable brands.

The post Expert released PoC exploit code for unpatched backdoor in HiSilicon chips appeared first on Security Affairs.