Co-Author: Ghanashyam Satpathy
Summary
A new zero-day vulnerability (CVE-2021-40444) affecting multiple versions of Windows has recently been discovered and disclosed by Microsoft. According to Microsoft’s Security Update Guide, the MSHTML component can be exploited by an attacker through a custom ActiveX control, allowing remote code execution. This zero-day vulnerability can be triggered through weaponized Office documents and there is evidence of documents exploiting this vulnerability in the wild.
Microsoft has not yet released a security patch, but has released a workaround that can be implemented to protect systems from this vulnerability. You can also use Protected View or Application Guard for Office, either of which can mitigate this issue.
Netskope Threat Protection detects and blocks files related to CVE-2021-40444, protecting our customers from this recently discovered exploit.
This security issue has a severity level (CVSS) of 8.8 out of 10, and in this blog post, we will analyze a malicious Office document that exploits this zero-day vulnerability.
Analysis
The sample we analyzed was a weaponized Microsoft Word document that was first uploaded to VirusTotal on September 09, 2021, under the name “A Letter before court 4.docx”.
If Microsoft Protected View isn’t enabled, the vulnerability allows the malicious code to be executed as soon as the victim opens the document, requiring no interaction from the user whatsoever, differently from other kinds of infected Office documents where the victim usually needs to click a button to enable malicious VBA Macros.
By default, Microsoft Office files downloaded from the internet are opened in Protected View or Application Guard for Office, which mitigate the issue unless the user explicitly allows the content from the document.
The text of the document itself is just a decoy, designed to create a sense of urgency to trick the user into opening the document, and realistic enough so that they don’t suspect anything is awry after they open it.
As previously mentioned, the exploit doesn’t require any macros at all, as the malicious script will be loaded automatically by Microsoft Word. By analyzing the network traffic, we can see two GET requests coming from Word’s process.
At the time of the analysis, both payload URLs were offline, so we simulated a server to deliver all files required for the exploit to work.
Soon after these network requests, we can see the MSHTML DLL being loaded, which according to Microsoft is the component that contains the vulnerability.
After the payloads were downloaded, we can see Word’s process spawning “control.exe”, which eventually calls “rundll32.exe”.
To understand what is happening, we need to take a closer look at the weaponized Word document. The file is in the Office Open XML (OOXML) format, meaning that we can decompress and analyze its elements individually.
Once the file is decompressed, we take a look into the OOXML relationships by following the steps shown in the image below.
Inside that file, one of the defined relationships stands out before the others, as we can see in the image below.
This external relationship is the only feature implemented by the attacker in the document. Now, we need to take a look in the “side.html” file.
The “side.html” is an HTML file that contains JavaScript, which is likely the code that triggers the vulnerability. Although we can see some of the variables used by the code, such as the URL for the final payload, it’s difficult to understand what the script is actually doing due to the obfuscation implemented by the attacker.
After a small deobfuscation, we can see that the code downloads a file named “ministry.cab”, extracts a DLL named “championship.inf”, and then it uses a sequence of path traversal as an attempt to execute the file.
Analyzing Procmon logs, we can see these calls being executed by the process “control.exe”, trying to load the DLL with “rundll32.exe”.