Skip to main content
Mallory
HighExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2021-40444: Microsoft MSHTML Remote Code Execution

Published Sep 15, 2021 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.8High · v3.1
EPSS97.8%100th percentile
CISA KEVYesAdded Nov 3, 2021
In the wildActivePer CISA KEV
Vendor
Microsoft Corporation
IdentifiersCVE-2021-40444CWE-22 · Improper Limitation of a Pathname…

CVE-2021-40444 is a remote code execution vulnerability in the Microsoft MSHTML browser rendering engine on Windows. Attackers can distribute specially crafted Microsoft Office documents that load externally linked MHTML/OLE content and invoke malicious ActiveX controls. Exploitation can abuse CAB archive path traversal to place an attacker-controlled payload and execute it. The documented attack requires a user to open the malicious document and executes code with that user's privileges. The vulnerability was exploited as a zero-day before Microsoft released security updates on September 14, 2021.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation compromises the affected Windows endpoint through arbitrary code execution in the victim user's security context. Administrative users expose the system to greater compromise than standard users. Observed exploitation has delivered information stealers, spyware, remote-control implants, and ransomware, enabling credential theft, surveillance, data exfiltration, and file encryption. The vulnerability does not itself establish elevated privileges beyond those of the affected user.

Mitigation

If you can’t patch tonight, do this now.

Keep internet-origin Office documents in Protected View or Application Guard for Office, which prevent the documented attack. Disable installation of new signed and unsigned ActiveX controls across Internet Explorer security zones for both 32-bit and 64-bit processes. Enable the Microsoft Defender attack surface reduction rule that blocks Office applications from creating child processes. Keep Microsoft Defender Antivirus and Defender for Endpoint current; detection build 1.349.22.0 or newer provides protection against known exploitation. Additional measures include disabling Windows Explorer previews for Word and RTF documents and using accounts without administrative privileges.

Remediation

Patch, then assume compromise.

Install the applicable Microsoft Windows security updates released on September 14, 2021, or superseding updates that include the fix. Ensure that the selected update combination covers MSHTML: on Windows 8.1, Windows Server 2012, and Windows Server 2012 R2, install either the Monthly Rollup or both the Security Only and Internet Explorer Cumulative updates. On Windows 7, Windows Server 2008, and Windows Server 2008 R2, the Monthly Rollup includes the fix; Security Only deployments also require the applicable Internet Explorer Cumulative update.

Public exploits

Exploits

11 exploits validated by Mallory's analysis. Hidden: 10 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
word_mshtml_rce.rbThis repository contains a single Metasploit module: 'modules/exploits/windows/fileformat/word_mshtml_rce.rb'. The module exploits CVE-2021-40444, a remote code execution vulnerability in Microsoft Office Word's handling of MSHTML (browser rendering engine) via malicious ActiveX controls embedded in DOCX files. The exploit works by generating a specially crafted DOCX file ('msf.docx') that, when opened on a vulnerable Windows system, causes Word to fetch and execute a payload (typically a DLL) from an attacker-controlled HTTP(S) server. The module allows for payload customization and uses a DOCX template ('cve-2021-40444.docx') to build the malicious document. The attack vector is a combination of file format exploitation (malicious DOCX) and network delivery (HTTP/S server for payloads). The exploit is weaponized, as it is part of the Metasploit framework and supports arbitrary payloads. The only endpoints directly referenced are the generated DOCX file and the local HTTP(S) server used to deliver the payload. The code is well-structured, leverages Metasploit's libraries, and is intended for use by penetration testers to demonstrate or test the vulnerability.Disclosed Sep 23, 2021 · Framework: metasploit · ruby · fileformat · networkWeaponizedMicrosoft-Office-Word-MSHTML-Remote-Code-Execution-ExploitThis repository contains a Metasploit module (Microsoft-Office-Word-MSHTML_Exploit.rb) that exploits CVE-2021-40444, a remote code execution vulnerability in Microsoft Office Word's handling of MSHTML (browser rendering engine) via malicious ActiveX controls. The module generates a malicious DOCX file ('msf.docx') that, when opened on a vulnerable Windows system, triggers code execution by loading further payloads from an attacker-controlled HTTP(S) server. The exploit leverages both file format and network attack vectors: the initial infection vector is the crafted DOCX file, and subsequent payloads (HTML, CAB, DLL) are served over HTTP/HTTPS. The module allows for payload customization using Metasploit's payload system, making it weaponized and suitable for red teaming or penetration testing. The repository structure is simple, with the main exploit logic in the Ruby file and a brief README describing its purpose.34zY · Disclosed Dec 19, 2021 · Framework: metasploit · ruby · fileformat · networkWeaponizedCVE-2021-40444This repository is a fully weaponized exploit generator for CVE-2021-40444, a critical Microsoft Office Word Remote Code Execution vulnerability. The exploit leverages a crafted .docx file that references a malicious HTML file, which in turn uses ActiveX and path traversal in a CAB file to drop and execute an attacker-controlled DLL or script via the .cpl URI handler. The repository includes Python scripts (generator.py, cab_parser.py) to automate the creation and patching of malicious CAB files, generate the required DDF files, and serve the payloads via a simple web server (util/server.py). Multiple HTML templates are provided for different obfuscation and delivery strategies, including CAB-less and RAR-based variants. Test payloads (calc.js, calc.vbs, calc.hta, job-jscript.wsf, job-vbs.wsf) demonstrate code execution. The exploit is highly configurable, allowing the attacker to specify the payload, hosting URL, and output format. The structure is modular, with clear separation between payload generation, document crafting, and hosting. This is a mature, weaponized exploit toolkit targeting unpatched Microsoft Office installations on Windows, capable of delivering arbitrary code execution via document-based attack vectors.MRacumen · Disclosed Dec 28, 2021 · python · javascript · network · document · browserWeaponizedCVE-2021-40444_EXP_JSThis repository contains a single JavaScript file, 'loader.js', which implements a browser-based exploit targeting Internet Explorer on Windows systems. The exploit leverages ActiveX objects and the 'htmlfile' COM object to create a controlled environment, then attempts to download a remote CAB file ('http://hidusi.com/e8c76295a5f9acb7/ministry.cab') and instantiate it via an embedded object element. The script manipulates the DOM and uses various file paths (e.g., 'AppData/Local/Temp/Low/championship.inf') that suggest attempts to drop or interact with files on the victim's system. The exploit is operational and could lead to remote code execution if run in a vulnerable environment. The code is not part of a known exploit framework and is written in JavaScript, designed to be executed in a browser context with ActiveX enabled.bambooqj · Disclosed Sep 9, 2021 · javascript · browserOperationalCVE-2021-40444_buildersThis repository provides a full builder toolkit for constructing exploits targeting CVE-2021-40444, a critical Microsoft Office Word remote code execution vulnerability. The structure includes a set of Python scripts: 'generate_cab.py' creates a malicious CAB archive containing an attacker-supplied DLL; 'generate_html.py' produces an HTML file referencing the CAB file; and 'generate_doc.py' crafts a Word document (.docx) that embeds an external OLE object reference to the attacker's HTML or CAB file. The 'doc' directory contains template Office XML files that are modified by the scripts to include the malicious references. The README provides detailed instructions for using the toolkit, including AV evasion tips (such as using uppercase 'HTTP' and backslashes in URLs). The exploit chain is: (1) attacker prepares a DLL payload, (2) builds a CAB file, (3) hosts the CAB and HTML files, (4) generates a malicious .docx that references the attacker's content, and (5) delivers the document to a victim. When opened, the document causes Office to fetch and execute the attacker's DLL, resulting in arbitrary code execution. The repository is operational and can be used to generate working exploits for CVE-2021-40444, with customizable payloads and network endpoints.aslitsecurity · Disclosed Sep 12, 2021 · python · network · fileOperationalCVE-2021-40444This standalone CVE-2021-40444 reproduction repository contains 15 files: a README, two Python utilities, two HTML files containing JavaScript, and ten XML document-package components. C payload source and shell build examples are embedded in the README rather than supplied as separate source files. It is exploit code, not a scanner or detection-only project. The intended chain starts when a user opens a crafted DOCX assembled from maldoc/. Its external OLE relationship references attacker-controlled HTML using mhtml: and x-usc:. The main page, www/exploit.html, uses an array-rotation/string-index obfuscator. Its readable counterpart, www/deob.html, exposes the core behavior: create an iframe, obtain ActiveXObject, construct nested htmlfile objects, synchronously request a CAB, and insert an object with a CAB codebase and a fixed CLSID. Subsequent .cpl: Script.location assignments try several relative paths to execute championship.inf, a native DLL masquerading as an INF file. This is a macro-free delivery chain. patch_cab.py modifies a locally generated CAB in place at offset 0x2d and rewrites its traversal-bearing member pathname. deobfuscate.py performs static substitutions using a precomputed string table; it does not execute or detect the vulnerability. The remaining XML files provide Word document content, relationships, styles, settings, fonts, theme, and metadata. The supplied payload example launches Calculator on DLL_PROCESS_ATTACH. This supports an OPERATIONAL classification for a basic hardcoded demonstration, but does not establish successful execution of this snapshot. No compiled DLL, CAB, or assembled DOCX is included. The listed package also lacks the media files referenced by its relationships and a top-level _rels/.rels file, which may affect document completeness. The readable HTML and helper retain test.cab while the main page uses out.cab. The HTML helper also expects its input in the current working directory. These inconsistencies require attention before reproduction, and some supplied XML content is truncated, limiting static verification. All network addresses shown are loopback examples or unresolved placeholders, not evidence of an active command-and-control service. No credential theft, persistence, exfiltration, reverse shell, or registry modification is present in the visible code. Repository URL, revision, archive path, and archive size were not supplied; empty metadata and size 0 represent unavailable information.m4madturk · Disclosed Sep 14, 2021 · python · javascript · file · webOperationalCVE-2021-40444-SampleThis repository is a proof-of-concept (POC) exploit for CVE-2021-40444, a remote code execution vulnerability in Microsoft Internet Explorer (and related Windows components) via malicious ActiveX controls. The repository contains two files: a brief README and a 'poc.html' file. The HTML file contains obfuscated JavaScript that creates multiple iframes and ActiveX objects, then attempts to download a malicious CAB file from 'http://localhost/trojan.cab' and load it using a specific ActiveX class ID. The script also manipulates file paths such as 'AppData/Local/Temp/Low/whoiam.inf' to potentially drop or interact with files on the target system. The exploit is designed to be opened in Internet Explorer 11 on Windows, with ActiveX enabled, and demonstrates the attack vector but does not include a real payload (the CAB file is referenced as 'localhost'). This POC is intended for research and demonstration purposes.k4k4 · Disclosed Sep 10, 2021 · html · javascript · browserPoCCVE-2021-40444This repository provides a full proof-of-concept exploit for CVE-2021-40444, a critical remote code execution vulnerability in Microsoft Windows MSHTML (Trident) engine, exploited via malicious Office documents. The structure includes: - A 'maldoc' directory containing the components of a malicious DOCX file, with instructions to modify 'document.xml.rels' to point to a hosted HTML exploit. - 'www/exploit.html' and 'www/deob.html' are the obfuscated and deobfuscated HTML exploit files, respectively. These files use JavaScript and ActiveX to trigger the vulnerability and fetch a malicious CAB file containing a DLL payload. - 'patch_cab.py' and 'deobfuscate.py' are helper scripts for preparing the CAB file and deobfuscating the HTML exploit. - The payload is a DLL (calc.dll) that, when executed, launches calc.exe as a demonstration of code execution. - The README.md provides detailed step-by-step instructions for generating the malicious DOCX, CAB, and setting up the HTTP server to deliver the exploit chain. The exploit chain is as follows: a user opens the crafted DOCX, which loads a remote HTML file (exploit.html) via MSHTML. The HTML triggers the vulnerability, causing the system to fetch and execute a DLL from a CAB file, resulting in arbitrary code execution. The exploit is operational and demonstrates real code execution, but the payload is a simple demonstration (calc.exe).lockedbyte · Disclosed Sep 10, 2021 · python · html · network · filePoCCaboomThe repository 'Caboom' is a C# project designed to generate malicious .cab files for exploiting CVE-2021-40444, a Microsoft MSHTML remote code execution vulnerability. The main logic resides in 'Program.cs', which takes a user-supplied .dll or .inf file, uses CABARC.EXE to package it into a .cab archive, and then modifies specific bytes in the resulting file to create a final payload ('finalPayload.cab'). This crafted .cab file can be used in further exploitation scenarios, such as embedding in Office documents to trigger the vulnerability. The repository includes Visual Studio project files, configuration files, and build artifacts, but the core exploit logic is in 'Program.cs'. The tool is intended for penetration testers and red teamers, as stated in the README, and is not a detection script. No network endpoints are present; the attack vector is local file manipulation for subsequent use in remote attacks.mansk1es · Disclosed Sep 11, 2021 · csharp · localPoCCVE-2021-40444This repository is a fully weaponized exploit generator for CVE-2021-40444 (Microsoft Office Word Remote Code Execution) and CVE-2022-30190 (Follina, ms-msdt). It contains Python scripts (generator.py, cab_parser.py) to automate the creation of malicious DOCX/RTF files that exploit these vulnerabilities. The generator can embed arbitrary attacker-supplied payloads (DLLs, scripts) and supports multiple exploit chains, including CAB-based, CAB-less (RAR, HTML smuggling), and Follina (ms-msdt) variants. The exploit works by crafting a DOCX/RTF file that references a malicious HTML file, which in turn triggers the download and execution of a payload via ActiveX, CAB path traversal, or the ms-msdt protocol. The repository includes templates for the malicious HTML, test payloads (calc.exe launchers in various scripting languages), and a simple Python web server for hosting the payloads. The exploit is highly customizable and operational, supporting arbitrary code execution on vulnerable Windows systems with Microsoft Office. Notable endpoints include the use of HTTP(S) servers for payload delivery and various file paths in the Windows temp directories for payload drop and execution. The structure is modular, with clear separation between payload generation, file templates, and server hosting.klezVirus · Disclosed Sep 15, 2021 · python · javascript · network · document · browserPoCCVE-2021-40444This repository provides a proof-of-concept exploit for CVE-2021-40444, a critical remote code execution vulnerability in Microsoft Windows MSHTML (used by Microsoft Office). The main script, 'gen.py', automates the creation of a malicious Office document (.docx) that references a remote payload. The workflow is as follows: (1) The user prepares a .docx file with an embedded OLE object, (2) 'gen.py' modifies the document to reference a remote HTML file (template.html) hosted on an attacker-controlled server, (3) The HTML file uses obfuscated JavaScript to trigger the MSHTML exploit, causing the victim's system to fetch and execute a CAB file containing a malicious DLL via INF file trickery. The repository includes setup scripts and requirements for environment preparation. The exploit chain is network-based, requiring the victim to open the crafted document and connect to the attacker's HTTP server. The main endpoints are the attacker's HTTP server (e.g., http://10.10.10.10) and various file paths on the victim's system where the payload is dropped. The exploit is a functional proof-of-concept and does not include a weaponized or highly automated payload delivery system, but demonstrates the full attack chain for CVE-2021-40444.H0j3n · Disclosed Oct 3, 2021 · python · bash · network · filePoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Microsoft CorporationWindows 10 1507operating_system
Microsoft CorporationWindows 10 1607operating_system
Microsoft CorporationWindows 10 1809operating_system
Microsoft CorporationWindows 10 1909operating_system
Microsoft CorporationWindows 10 2004operating_system
Microsoft CorporationWindows 10 20h2operating_system
Microsoft CorporationWindows 10 21h1operating_system
Microsoft CorporationWindows 7operating_system
Microsoft CorporationWindows 8.1operating_system
Microsoft CorporationWindows Rt 8.1operating_system
Microsoft CorporationWindows Server 2004operating_system
Microsoft CorporationWindows Server 2008operating_system
Microsoft CorporationWindows Server 2008 R2operating_system
Microsoft CorporationWindows Server 2008 Sp2operating_system
Microsoft CorporationWindows Server 2012operating_system
Microsoft CorporationWindows Server 2012 R2operating_system
Microsoft CorporationWindows Server 2016operating_system
Microsoft CorporationWindows Server 2019operating_system
Microsoft CorporationWindows Server 2022operating_system
Microsoft CorporationWindows Server 20h2operating_system
FAQ

Frequently asked questions

Is CVE-2021-40444 exploited in the wild?
Yes. As of Oct 18, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Nov 3, 2021.
Is there a public exploit for CVE-2021-40444?
Yes. Mallory tracks 11 public exploits or proofs of concept for CVE-2021-40444, the earliest disclosed Sep 9, 2021.
Is there a patch for CVE-2021-40444?
Install the applicable Microsoft Windows security updates released on September 14, 2021, or superseding updates that include the fix. Ensure that the selected update combination covers MSHTML: on Windows 8.1, Windows Server 2012, and Windows Server 2012 R2, install either the Monthly Rollup or both the Security Only and Internet Explorer Cumulative updates.
What products are affected by CVE-2021-40444?
Microsoft Corporation Windows 10 1507, Microsoft Corporation Windows 10 1607, Microsoft Corporation Windows 10 1809, Microsoft Corporation Windows 10 1909, Microsoft Corporation Windows 10 2004, and at least 15 more.
How severe is CVE-2021-40444?
CVE-2021-40444 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 97.8% (100th percentile) as of Oct 18, 2026.
Activity feed

Recent activity

69 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
trellix otherNews · Aug 24, 2026The Tale of Two Exploits - Breaking Down CVE-2023-36884 and the Infection ChainA historical vulnerability cited as an example of Office documents carrying exploits or linking to malicious external resources that exploit object-rendering components. The article provides no further vulnerability-specific technical details.Read more ↗trellix otherNews · Aug 24, 2026Prime Minister’s Office Compromised: Details of Recent Espionage CampaignAn MSHTML remote code execution vulnerability exploited through malicious Excel documents in an espionage campaign active during October–November 2021. Embedded OLE links retrieved attacker-hosted HTML, which invoked the Internet Explorer engine to trigger exploitation and execute a DLL downloader. Subsequent stages deployed Graphite and Empire agents against government and defense targets in Western Asia and Eastern Europe. The report tentatively attributes the campaign to APT28, with inconsistent low-to-moderate confidence statements.Read more ↗codebyNews · Jul 18, 2026Initial Access Broker: рынок доступов и обнаружениеAn MSHTML remote code execution vulnerability presented as an example of initial-access exploitation. The article describes malicious Office documents using ActiveX and CAB archive path traversal to place an INF file and achieve code execution after the victim opens the document. It reports a CVSS score of 8.8, exploitation by DEV-0413 in September 2021, and inclusion in CISA's Known Exploited Vulnerabilities catalog on November 3, 2021.Read more ↗codebyNews · Jul 7, 2026Анализ вредоносных документов: макросы Office и PDFУязвимость удалённого выполнения кода в MSHTML, эксплуатируемая через вредоносные Office OOXML-документы с external relationship и ActiveX-контентом, без необходимости включать макросы.Read more ↗
+57 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence15Every report linking this CVE to a named adversary.
Associated malware48Malware families linked to this CVE, with evidence and IOCs.
Detection signatures8YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity4Community discussion across Reddit, Mastodon, and other social sources.