
Proof-of-concept exploit for Microsoft Office security feature bypass (CVE-2026-21509). Generates malicious DOCX files with embedded OLE objects to test security controls and validate patches.

Status: Actively exploited → Emergency patch released Severity: 🔴 High Risk Type: Security Feature Bypass
CVE-2026-21509 is a serious vulnerability in Microsoft Office that allows attackers to bypass built-in security protections by tricking Office into trusting malicious files.
Once opened, these files can:
| Field | Value |
|---|
| CVE ID | CVE-2026-21509 |
| Category | Security Feature Bypass |
| Exploitation | Confirmed in the wild |
| User Interaction | Required (must open file) |
| Preview Pane | ❌ Not affected |
Attackers send malicious Word or Excel documents via phishing or social engineering. When a user opens the file, Office’s trust mechanisms are bypassed — making it easier to run harmful content.
Install: pip install python-docx olefile
Run: python3 CVE-2026-21509.py --output test.docx --clsid YOUR_CLSID
Test: Open test.docx in vulnerable Office VM (pre-patch). Monitor with ProcMon; if bypass works, OLE loads without block prompt.
Enhance:
oletools (pip install oletools): rtfobj to craft RTF OLE, or olevba to add VBA auto-run.If the Python PoC for CVE-2026-21509 works successfully (on a system with the required libraries installed), here's exactly what you'd see step by step:
python3 CVE-2026-21509.py --output test.docx --clsid EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B
Expected Success Output:
OLE binary saved as embedded_ole.bin (embed manually in DOCX if needed via tools like oletools)
Generated malicious DOCX: test.docx
Open in vulnerable Office (pre-patch) to test bypass. Use isolated VM!
ImportError, OSError, or XML issues).test.docx (the malicious document) and embedded_ole.bin (the OLE stream for reference).If it fails (e.g., missing python-docx or olefile):
ModuleNotFoundError: No module named 'docx'
Fix: pip install python-docx olefile
On Vulnerable Office (pre-Jan 26, 2026 patch, e.g., Office 2016/2019 unpatched):
HKCR\CLSID\{EAB22AC3-...}) without block events.On Patched Office (or with registry kill bit applied):
| Step | What You See (Success) | What It Means |
|---|---|---|
| Script Run | "Generated malicious DOCX: test.docx" | File created successfully |
| OLE Bin Saved | "embedded_ole.bin" file appears | OLE stream ready for embedding |
| Open in Vulnerable Office | No block/prompt; OLE loads or icon shows | Bypass worked (security decision skipped) |
| Open in Patched Office | Warning/block message or gray placeholder | Patch/registry fix is effective |
Pro Tips:
oletools to inspect the DOCX (olevba test.docx or rtfobj) and add real malicious OLE data.OleViewDotNet.exe (free tool).Patch Office immediately if affected! If you run it and get specific output/errors, paste them here for debugging. 😈
This information is provided for awareness and defensive security purposes only. No liability is assumed for misuse or inaccuracies.