Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2021-24067

CVE-2021-24067: Microsoft Excel RCE Vulnerability

CVE-2021-24067 is a remote code execution vulnerability in Microsoft Excel that enables attackers to execute arbitrary code. This article covers the technical details, affected versions, security impact, and mitigation.

Updated:

CVE-2021-24067 Overview

CVE-2021-24067 is a remote code execution vulnerability in Microsoft Excel and related Office products. The flaw is classified as a use-after-free condition [CWE-416] in Excel's document parsing logic. An attacker who successfully exploits this vulnerability can execute arbitrary code in the context of the current user. Exploitation requires the victim to open a crafted Excel file, making spear-phishing and malicious document delivery the most likely attack scenarios. Microsoft addressed the issue in its February 2021 security updates.

Critical Impact

Successful exploitation allows arbitrary code execution with the privileges of the user opening a malicious Excel document, enabling malware installation, data theft, and lateral movement.

Affected Products

  • Microsoft 365 Apps for Enterprise
  • Microsoft Excel 2010 SP2, 2013 SP1 (including RT), and 2016
  • Microsoft Office 2019 for Windows and macOS
  • Microsoft Office Online Server and Office Web Apps 2013 SP1

Discovery Timeline

  • 2021-02-25 - CVE-2021-24067 published to the National Vulnerability Database
  • 2024-11-21 - Last updated in the NVD database

Technical Details for CVE-2021-24067

Vulnerability Analysis

The vulnerability is a use-after-free defect [CWE-416] in Microsoft Excel's handling of crafted spreadsheet content. Excel frees a memory object during parsing but retains a dangling reference that is subsequently dereferenced. Attackers shape the freed allocation to control the object contents, redirecting execution flow when the stale pointer is reused.

The attack vector is local and requires user interaction. A victim must open a malicious .xls or .xlsx file delivered through email, web download, or shared storage. Successful exploitation grants the attacker code execution at the privilege level of the logged-in user. On systems where users hold administrative rights, the attacker gains full control of the host.

Exploitation in the Preview Pane is not required for this issue, but social-engineering vectors such as macro-laden lures and fake invoice attachments remain the primary delivery method observed for Office document RCE chains.

Root Cause

The root cause is improper object lifetime management within Excel's parsing routines. A specific record or embedded structure triggers premature deallocation of an internal object while a pointer to that object remains in use. When the dangling pointer is later dereferenced, attacker-controlled data interpreted as a valid object provides primitives for arbitrary read, write, and ultimately code execution.

Attack Vector

The attacker crafts a malicious Excel workbook that triggers the use-after-free condition during file parsing. The document is delivered to a target via phishing email, watering-hole download, or trusted file-sharing channel. When the target opens the file in a vulnerable Excel build, Excel processes the malicious structure, dereferences the freed object, and executes attacker-supplied shellcode.

No verified public proof-of-concept is associated with this CVE. Microsoft's advisory for CVE-2021-24067 is the authoritative technical reference. See the Microsoft Security Advisory CVE-2021-24067 for vendor guidance.

Detection Methods for CVE-2021-24067

Indicators of Compromise

  • Excel processes (EXCEL.EXE) spawning unusual child processes such as cmd.exe, powershell.exe, wscript.exe, rundll32.exe, or mshta.exe.
  • Outbound network connections initiated directly by EXCEL.EXE to untrusted hosts shortly after a document is opened.
  • Unexpected writes to startup, Run registry keys, or scheduled tasks following the opening of an Office document.
  • Crash dumps of EXCEL.EXE referencing access violations during file parsing, consistent with use-after-free exploitation attempts.

Detection Strategies

  • Hunt for Office applications creating child processes outside of expected scripting and update binaries using endpoint telemetry.
  • Alert on Excel writing executables, scripts, or DLLs to user-writable paths such as %TEMP%, %APPDATA%, or %PUBLIC%.
  • Correlate document open events with subsequent network egress from EXCEL.EXE to surface staged droppers and second-stage payloads.

Monitoring Recommendations

  • Enable Microsoft Defender Attack Surface Reduction rules that block Office applications from creating child processes and writing executable content.
  • Collect Sysmon Event IDs 1, 7, and 11 from endpoints running Office and forward to a centralized analytics platform for behavioral hunting.
  • Monitor mail gateway logs for inbound Office attachments with macros, OLE objects, or embedded ActiveX controls.

How to Mitigate CVE-2021-24067

Immediate Actions Required

  • Apply the February 2021 Microsoft security updates for Excel, Office, Microsoft 365 Apps, Office Online Server, and Office Web Apps.
  • Inventory all endpoints running Excel 2010 SP2, Excel 2013 SP1, Excel 2016, Office 2019, and Microsoft 365 Apps to confirm patch coverage.
  • Block inbound Office documents from untrusted external senders at the mail gateway until patches are confirmed deployed.
  • Restrict standard users from local administrator rights to limit the impact of successful exploitation.

Patch Information

Microsoft released fixes for CVE-2021-24067 as part of the February 2021 Patch Tuesday. Refer to the Microsoft Security Advisory CVE-2021-24067 for the complete list of update KB numbers per product channel. Microsoft 365 Apps customers receive the fix through the standard Click-to-Run update channel.

Workarounds

  • Open untrusted Excel files in Protected View and disable the option to exit Protected View on user demand.
  • Disable macros and ActiveX controls via Group Policy for users who do not require them.
  • Enforce the File Block policy to prevent older Excel binary formats from opening outside of Protected View.
  • Use Application Guard for Office to render untrusted documents in an isolated container.
bash
# Group Policy registry settings to enforce Protected View and block legacy Excel formats
reg add "HKCU\Software\Microsoft\Office\16.0\Excel\Security\ProtectedView" /v DisableInternetFilesInPV /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Office\16.0\Excel\Security\ProtectedView" /v DisableAttachmentsInPV /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Office\16.0\Excel\Security\FileBlock" /v XL97Workbooks /t REG_DWORD /d 2 /f
reg add "HKCU\Software\Microsoft\Office\16.0\Excel\Security\FileBlock" /v OpenInProtectedView /t REG_DWORD /d 1 /f

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.