
PowerShell script that applies a temporary registry-based mitigation for CVE-2026-21509, a Microsoft Office security feature bypass, with backup and rollback support.
Traditional Chinese version: README_zh-TW.md
This script applies a registry-based mitigation to protect against CVE-2026-21509 (Microsoft Office security feature bypass vulnerability), which has been exploited in the wild.
CVE ID: CVE-2026-21509
Severity: Important
Impact: Security Feature Bypass
Affected Products: Microsoft Office 2016 and 2019
Before running the script, please visit: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-21509 In the Security Updates section, confirm there is a download link that matches your Office version.
This registry change provides immediate protection but does not replace the official security update. You must still install the security update (KB5002713) as soon as possible.
CVE-2026-21509_Mitigation.ps1 - PowerShell script that applies the registry keysApply_CVE-2026-21509_Mitigation.bat - Batch launcher (easier to run)README.md - This fileApply_CVE-2026-21509_Mitigation.baty or Y and press Enter to continueSet-ExecutionPolicy Bypass -Scope Process -Force./CVE-2026-21509_Mitigation.ps1The script explains the changes in detail and asks for confirmation before applying them. The flow:
Phase 1: Information and confirmation
Show vulnerability information
List planned actions
Ask for confirmation
y or Y continues, anything else cancelsPhase 2: Apply changes (only after confirmation)
HKLM\SOFTWARE\Microsoft\Office\16.0\Common\COM CompatibilityHKLM\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\...{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}0x00000400Depending on your system and Office configuration, the script applies changes to one or more of the following paths:
64-bit MSI Office (or 32-bit on 32-bit Windows):
HKLM\SOFTWARE\Microsoft\Office\16.0\Common\COM Compatibility\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}
32-bit MSI Office on 64-bit Windows:
HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\16.0\Common\COM Compatibility\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}
64-bit Click-to-Run (or 32-bit on 32-bit Windows):
HKLM\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Office\16.0\Common\COM Compatibility\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}
32-bit Click-to-Run on 64-bit Windows:
HKLM\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\WOW6432Node\Microsoft\Office\16.0\Common\COM Compatibility\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}
To verify that the registry keys were applied:
Win + R, type regedit, and press EnterCompatibility Flags = 0x00000400If you need to remove the mitigation:
RegistryBackup_CVE-2026-21509_*.regOr manually delete the registry keys created by the script.
This script is provided "as is" without warranty of any kind. Test in a non-production environment first. The registry backup feature helps ensure you can restore changes if needed.
Code generation note: This code was generated with Claude AI.
If you have questions about this vulnerability, contact Microsoft Support or refer to official guidance from the Microsoft Security Response Center.
A: Yes. As of January 26, 2026, Microsoft has released security updates for Office 2016 and 2019. Customers should ensure these updates are installed to protect against this vulnerability.
A:
A:
A: Yes. This registry mitigation is temporary. You must install the official security update for full protection.
A: No, but exploitation has been detected in the wild.
A: Microsoft 365 Apps for enterprise users should ensure the latest updates are installed. Systems configured for automatic updates do not require additional action.
Resolution: Right-click the batch file and select "Run as administrator"
Resolution: Open PowerShell as administrator and run:
Set-ExecutionPolicy Bypass -Scope Process -Force
Possible causes:
Resolution:
This mitigation blocks the following CLSID:
{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}This CLSID is associated with a vulnerable OLE control that attackers can use to bypass Office security features.
The value 0x00000400 (DWORD) instructs Office to block loading this specific COM object, preventing exploitation.
This mitigation should not affect normal Office functionality. If you experience issues, use the Desktop backup file to restore the registry changes.
If you encounter issues or have suggestions for improvement: