Microsoft MSHTML Remote Code Execution Vulnerability
As part of our ongoing threat intelligence efforts to discover emerging threats and vulnerabilities, the CyOps team would like to bring a new risk to your attention. On September 7th, 2021, Microsoft disclosed a new zero-day vulnerability carrying the identifier CVE-2021-40444 which is already being exploited in the wild. In this update, we will cover how the vulnerability works and how you can defend against it.
CVE-2021-40444 is a remote code execution vulnerability that allows an attacker to run arbitrary code on a victim’s machine via ActiveX control usually sent to the victim via spear-phishing. Based on CVE-2021-40444, an attacker can craft a malicious ActiveX control to be used by a Microsoft Office document that hosts the browser rendering engine. The attacker would then have to convince the user to open the malicious document. Once the user opens the document, the vulnerability is then exploited and the attacker can execute arbitrary code.
The new zero-day is a critical risk vulnerability in the Trident MSHTML rendering engine. Threat actors exploiting this vulnerability are targeting and attacking Office 365 on numerous OS versions and Office 2019 on Windows 10. This exploit uses ActiveX controls and .cpl files and is a highly sophisticated attack.
ActiveX controls are small program parts that can be used to create and execute applications that work over the Internet through web browsers such as online Office apps. On top of that, ActiveX allows applications to share functionality and data through web browsers. This ActiveX vulnerability and many more can be deployed through malicious Microsoft Office documents and are often used in spear-phishing campaigns.
In this case, the malicious code is hidden in .cpl files which are used for control panel items, but are actually similar to DLL files and can be executed.
In order for this attack to succeed the differential between the user’s privilege is critical as executing these malicious documents with administrators poses additional risks.
Each one of these will protect your machines from the attack:
Do not open office documents from people you don’t know!
1)Microsoft’s Protected View is a protection method that is enabled by default when opening Office documents from the internet or from unsafe locations. These documents will be opened in read-only mode to prevent execution of malicious content. You should not disable this protection and not click on buttons asking you to turn it off. Additionally, IT admins should make sure all office users are running with this feature enabled.
2) Enabling Application Guard is a security container that isolates unknown documents from the rest of your personal data. This can be enabled from “Windows Turn Off and On” settings page.
3) Disabling ActiveX control can mitigate this attack, by modifying the relevant registry keys. To modify the registry keys and disable ActiveX controls please follow the instructions below: Download here and execute the following file → “disable-activex.reg” after the execution of the file reboot the machine. (This file needs to be executed with elevated privileges).
This file was published by MS and disables ActiveX in your registry. Another option that doesn’t include downloading the file is to simply create a text file called “disable-activex.reg” Copy-paste the text box below and change the file extension to .reg
In case you wish to undo this step, you can delete the registry keys that were added.
Important note – Cynet can automate a temporary mitigation recommended by Microsoft that can be done using Cynet. Please download or create the file (disable-activex.reg”) on a machine on which you can access the Cynet UI console.
Follow this instructions to complete this task through Cynet UI. Workflow:
First, we will create a folder called “Disable ActiveX” that will contain two crucial files.
Place the disable-activex.reg file you have created or downloaded in this folder.
Create a batch file called starter.bat and place it over the Disable ActiveX folder.
starter.bat should contain the following lines:
cmd.exe /c reg import disable-activex.reg
Now we are ready to create a custom remediation that will execute the script on the machine.
Action Name: Disable ActiveX
Remediation Category: Host
Execution Location: Endpoint
Select File/Folder: Folder
Click Choose file and choose the folder we have created.
Upon adding this folder click upload files.
File to execute: starter.bat
Then go to “Hosts” → “Forensic”, under the “Forensic”tab:
Choose the machines you want to enumerate, and click on Actions.
Then execute the custom remediation we created:
This action will be executed on all hosts you have selected.
As always, we are available for any questions or concerns and in any case further assistance is required.
Indicators Of Compromise
Cynet Threat Intellegnce team observed several IOCs as part of the ongoing hunting efforts that seem to be related to the vulnerability exploitation as they were using ActiveX. Below you can find several IOCs for these attacks: