TECHNICAL ANALYSISEXPLOIT DEVELOPMENTCVE-2022-24990

CVE-2022-24990 — TerraMaster NAS Administrative Password Disclosure

TerraMaster NAS 4.2.29 and earlier allows remote attackers to discover the administrative password by sending "User-Agent: TNAS" to module/api.php?mobile/webNasIPS and then reading the PWD field in the response.

Originally published on Rapid7 AttackerKB · 2023-06-10 · revised 2023-06-12

Overview

This assessment is the third entry in the TerrorMaster series targeting TerraMaster NAS devices running TerraMaster Operating System (TOS) 4.2.29 or lower.

Octagon Networks published in March 2022 an analysis CVE-2022-24990: TerraMaster TOS unauthenticated remote command execution via PHP Object Instantiation explaining a chain of vulnerabilities that makes all TerraMaster NAS servers running TOS version 4.2.29 and lower vulnerable for an unauthenticated RCE.

It basically combines CVE-2022-24990: Leaking sensitive information and CVE-2022-24989: Authenticated remote code execution to achieve an unauthenticated RCE by exploiting vulnerable endpoint api.php?mobile/webNasIPS leaking sensitive information such as admin password hash and mac address to achieve unauthenticated access and use the vulnerable endpointapi.php?mobile/createRaid with POST parameters raidtype / diskstring to execute remote code as root on TerraMaster NAS devices.

As usual, you can find the third module here in my local repository or as PR 18086 submitted at the Metasploit GitHub development.

With release of TOS 5.x, all of these vulnerabilities are now mitigated, but I would not be surprised that in the near future, some new exploits will come to surface looking back at the ugly history of TerraMaster flaws in the past.

Remediation

Please update your TOS version up to the latest supported TOS 4.2.x version or TOS 5.x version to be protected against all known vulnerabilities and do NOT to expose your TerraMaster NAS devices directly to the Internet.

References

Credits

Octagon Networks 0xf4n9x