CVE-2025-21298: Windows OLE RCE via Malicious RTF Document
Detects exploitation of CVE-2025-21298, a use-after-free (CWE-416) vulnerability in Windows OLE that allows remote code execution when a user opens a specially crafted RTF document. With a CVSS score of 9.8 and public PoC availability, this is a critical-severity vulnerability affecting Windows 10, 11, and Server 2008-2025. Exploitation typically involves phishing emails with RTF attachments that trigger the OLE subsystem to execute attacker-controlled code in the context of the victim user.
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- Microsoft
- Product
- Windows, Windows OLE
- Versions
- Windows 10, Windows 11, Windows Server 2008-2025
Weakness (CWE)
Timeline
- Disclosed
- January 14, 2025
- Patched
- January 14, 2025
References & Proof of Concept
CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What is CVE-2025-21298 CVE-2025-21298: Windows OLE RCE via Malicious RTF Document?
CVE-2025-21298: Windows OLE RCE via Malicious RTF Document (CVE-2025-21298) maps to the Initial Access and Execution and Defense Evasion tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for CVE-2025-21298: Windows OLE RCE via Malicious RTF Document, covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Microsoft Sentinel. The queries below are rated critical severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
let suspiciousRTFParents = dynamic(["winword.exe", "outlook.exe", "thunderbird.exe", "mimecast.exe", "explorer.exe"]);
let oleHosts = dynamic(["wordpad.exe", "winword.exe", "excel.exe", "powerpnt.exe", "outlook.exe"]);
let suspiciousChildren = dynamic(["cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "bitsadmin.exe", "wmic.exe"]);
union
(
DeviceProcessEvents
| where TimeGenerated >= ago(7d)
| where InitiatingProcessFileName in~ (oleHosts)
| where FileName in~ (suspiciousChildren)
| extend CommandLineLower = tolower(ProcessCommandLine)
| where CommandLineLower has_any ("http", "https", "ftp", "\\\\\\\\")
or CommandLineLower has_any ("invoke-expression", "iex", "downloadstring", "webclient", "start-process", "-enc", "-encodedcommand", "bypass")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, FolderPath, ReportId
| extend DetectionReason = "OLE host spawned suspicious child process"
),
(
DeviceFileEvents
| where TimeGenerated >= ago(7d)
| where InitiatingProcessFileName in~ (oleHosts)
| where FileName endswith ".rtf" or FileName endswith ".doc" or FileName endswith ".docx"
| where FolderPath has_any ("\\AppData\\Local\\Temp\\", "\\AppData\\Roaming\\", "\\ProgramData\\")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, FileName, FolderPath, ReportId
| extend DetectionReason = "OLE host wrote suspicious file to temp path"
),
(
DeviceEvents
| where TimeGenerated >= ago(7d)
| where ActionType == "OleObjectLinkFollowed" or ActionType == "ExploitGuardNetworkProtectionAudited"
| where InitiatingProcessFileName in~ (oleHosts)
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, ActionType, AdditionalFields, ReportId
| extend DetectionReason = "OLE link or exploit guard event from Office host"
)
| summarize count() by TimeGenerated, DeviceName, AccountName, DetectionReason, ReportId
| sort by TimeGenerated desc Detects CVE-2025-21298 OLE RCE exploitation by correlating Office/OLE host processes spawning suspicious child processes, writing files to temp paths, or triggering OLE link events. Covers both direct exploitation and post-exploitation activity from malicious RTF documents.
Data Sources
Required Tables
False Positives
- Legitimate macro-enabled documents that spawn cmd.exe for business automation tasks
- IT admin tools that use OLE embedding for legitimate deployment workflows
- Security testing tools or red team exercises using RTF documents
- Document conversion utilities that spawn child processes as part of normal operation
- Outlook add-ins that legitimately invoke shell commands via OLE
Sigma rule & cross-platform mapping
The detection logic for CVE-2025-21298: Windows OLE RCE via Malicious RTF Document (CVE-2025-21298) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2025-21298
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1RTF OLE Object Spawning CMD via WordPad
Expected signal: Sysmon EID 1: wordpad.exe spawning cmd.exe with parent-child relationship. DeviceProcessEvents in MDE showing InitiatingProcessFileName=wordpad.exe, FileName=cmd.exe.
- Test 2Simulate OLE Host Encoded PowerShell Download
Expected signal: Sysmon EID 1 with CommandLine containing '-EncodedCommand' or '-enc'. DeviceProcessEvents with ProcessCommandLine matching encoded command patterns.
- Test 3RTF File Drop to INetCache Simulating Email Attachment Open
Expected signal: Sysmon EID 11 (File Create): RTF file written to INetCache path with Outlook or Explorer as initiating process. DeviceFileEvents showing FileName ending in .rtf in INetCache path.
- Test 4OLE Host Unexpected Outbound Network Connection
Expected signal: Sysmon EID 3: Network connection event from powershell.exe (simulating Office host) to external IP on port 80. DeviceNetworkEvents showing InitiatingProcessFileName and DestinationIP for external address.
Unlock Pro Content
Get the full detection package for CVE-2025-21298 including response playbook, investigation guide, and atomic red team tests.