# CVE-2021-40444: Microsoft MSHTML Remote Code Execution

> Attackers can execute arbitrary code by tricking users into opening malicious Office documents that exploit a path traversal flaw in the MSHTML rendering engine.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L/E:P/RL:O/RC:C`)
- **Exploited in the wild:** Yes, since 3 Nov 2021 (CISA KEV), used in ransomware
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 Sep 2021
- **Updated:** 10 Aug 2026
- **Also known as:** GHSA-2h32-fhf6-xhh5, openSUSE-SU-2024:13674-1

## What is CVE-2021-40444?

CVE-2021-40444 is a high-severity path traversal vulnerability in Microsoft Windows 10 1507, published on 15 Sep 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Microsoft is investigating reports of a remote code execution vulnerability in MSHTML that affects Microsoft Windows. Microsoft is aware of targeted attacks that attempt to exploit this vulnerability by using specially-crafted Microsoft Office documents.
An attacker could 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. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.
Microsoft Defender Antivirus and Microsoft Defender for Endpoint both provide detection and protections for the known vulnerability. Customers should keep antimalware products up to date. Customers who utilize automatic updates do not need to take additional action. Enterprise customers who manage updates should select the detection build 1.349.22.0 or newer and deploy it across their environments. Microsoft Defender for Endpoint alerts will be displayed as: “Suspicious Cpl File Execution”.
Upon completion of this investigation, Microsoft will take the appropriate action to help protect our customers. This may include providing a security update through our monthly release process or providing an out-of-cycle security update, depending on customer needs.
Please see the Mitigations and Workaround sections for important information about steps you can take to protect your system from this vulnerability.
UPDATE September 14, 2021: Microsoft has released security updates to address this vulnerability. Please see the Security Updates table for the applicable update for your system. We recommend that you install these updates immediately. Please see the FAQ for important information about which updates are applicable to your system.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2021-40444?

It affects 17 products.


Products: Microsoft Windows 10 1507, Microsoft Windows 10 1607, Microsoft Windows 10 1809, Microsoft Windows 10 1909, Microsoft Windows 10 2004, Microsoft Windows 10 20h2, Microsoft Windows 10 21h1, Microsoft Windows 7, Microsoft Windows 8.1, Microsoft Windows Rt 8.1, Microsoft Windows Server 2004, Microsoft Windows Server 2008, Microsoft Windows Server 2012, Microsoft Windows Server 2016, Microsoft Windows Server 2019, Microsoft Windows Server 2022, Microsoft Windows Server 20h2.

## How do I fix CVE-2021-40444?

Apply the vendor's patch. US federal agencies must fix it by 17 Nov 2021.

## Is CVE-2021-40444 being exploited?

Yes. Attackers have exploited CVE-2021-40444 in the wild since at least 3 Nov 2021, including in ransomware campaigns.

Public exploit code:

- CVE-2021-40444 PoC (github_poc): https://github.com/lockedbyte/CVE-2021-40444
- CVE-2021-40444 - Fully Weaponized Microsoft Office Word RCE Exploit (github_poc): https://github.com/klezVirus/CVE-2021-40444
- This repo contain builders of cab file, html file, and docx file for CVE-2021-40444 exploit (github_poc): https://github.com/aslitsecurity/CVE-2021-40444_builders
- Modified code so that we don´t need to rely on CAB archives (github_poc): https://github.com/Edubr2020/CVE-2021-40444--CABless
- CVE-2021-40444 (github_poc): https://github.com/34zY/Microsoft-Office-Word-MSHTML-Remote-Code-Execution-Exploit
- https://github.com/k8gege/CVE-2021-40444 (github_poc): https://github.com/k8gege/CVE-2021-40444

## Other vulnerabilities in Microsoft Windows 10 1507

- [CVE-2017-8543](https://insights.sbomify.com/CVE-2017-8543/): Microsoft Windows Search Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2025-33053](https://insights.sbomify.com/CVE-2025-33053/): Microsoft Windows External Control of File Name or Path (high 8.8, exploited in the wild)
- [CVE-2025-33073](https://insights.sbomify.com/CVE-2025-33073/): Microsoft Windows SMB Client Improper Access Control (high 8.8, exploited in the wild)
- [CVE-2024-49039](https://insights.sbomify.com/CVE-2024-49039/): Microsoft Windows Task Scheduler Privilege Escalation (high 8.8, exploited in the wild)
- [CVE-2024-43461](https://insights.sbomify.com/CVE-2024-43461/): Microsoft Windows MSHTML Platform Spoofing (high 8.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-40444 and fix it if it is affected.

What it is: CVE-2021-40444 is a high-severity path traversal vulnerability in Microsoft Windows 10 1507, published on 15 Sep 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: Yes. Attackers have exploited CVE-2021-40444 in the wild since at least 3 Nov 2021, including in ransomware campaigns.

Affected product: Microsoft Windows 10 1507. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-40444/ (Markdown: https://insights.sbomify.com/CVE-2021-40444/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-40444
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-40444
- OSV: https://osv.dev/vulnerability/CVE-2021-40444

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-40444/
Summaries are generated and may contain mistakes; the official description above is the record.
