Office Macros: The Execution Surface Hiding in Your Inbox
Macros remain one of the most reliable ways into a Windows machine. Here is how to lock down Office macro execution and what WinSentinel checks.
Why macros are still the front door
Thirty years after the first macro virus, a Word document with a malicious macro is still one of the most reliable ways into a Windows machine. The delivery has barely changed: a phishing email, an invoice or resume attachment, and a yellow bar asking the user to click Enable Content. The user clicks because the document looks like work, the macro runs, and the attacker has code execution in a trusted process with the user's own privileges.
Security teams keep rediscovering this because the fix is not a patch. It is a configuration decision, made once per machine, and it is exactly the kind of setting that drifts: a helpdesk tech loosens it to unblock one user, a legacy line-of-business spreadsheet needs macros, and suddenly the whole fleet is back to trusting whatever arrives in the inbox.
What the settings actually do
Office macro security is controlled per application through the Trust Center, Group Policy, or the registry. The settings that matter:
- VBA macro notification settings — the master switch. Disable all macros without notification is the hardened position; Disable all macros with notification leaves the decision with the user, which is the same as leaving it open.
- Block macros from running in Office files from the Internet — the single most valuable setting in the set. Files carrying the Mark of the Web are treated as untrusted, and their macros are blocked outright instead of prompting. This is the control that kills the phishing attachment path.
- Trusted Documents and Trusted Locations — once a document is trusted, its macros run silently forever. Every trusted location is an exception to your policy, and attackers know it: a macro dropped into a trusted folder inherits the trust.
- Access to the VBA project object model — when enabled, code can write code. It should be off unless a specific application requires it.
- AMSI scanning of macros — Office hands macro content to the Antimalware Scan Interface before execution, so Defender can inspect obfuscated VBA at runtime. It only helps if macro execution reaches that point, which is why it is a backstop, not a policy.
The hardened baseline
For a machine that does not depend on macros for daily work, the baseline is short:
- Set macro notification to Disable all macros without notification in Word, Excel, PowerPoint, and Access.
- Enable Block macros from running in Office files from the Internet — via Group Policy at User Configuration > Administrative Templates > Microsoft Word 2016 > Word Options > Security > Trust Center, or the equivalent for Excel and PowerPoint.
- Clear Trusted Documents and keep the Trusted Locations list empty except for paths you can name and defend.
- Disable access to the VBA project object model.
- Verify the setting in the registry — for Word, the values live under
HKCU\Software\Microsoft\Office\16.0\Word\Security, withVBAWarningsset to4(disable all without notification) andblockcontentexecutionfrominternetset to1.
# Audit the macro baseline on one machine
Get-ItemProperty "HKCU:\Software\Microsoft\Office\16.0\Word\Security" |
Select-Object VBAWarnings, blockcontentexecutionfrominternet,
AccessVBOM, DisableAllActiveX
Get-ItemProperty "HKCU:\Software\Microsoft\Office\16.0\Excel\Security" |
Select-Object VBAWarnings, blockcontentexecutionfrominternet, AccessVBOM
What WinSentinel checks
WinSentinel audits the macro posture on the machine itself: the VBA warning level for each Office application, whether macros from the Internet are blocked, whether Trusted Documents are in use, and whether access to the VBA object model is open. Each of these is a finding with a concrete fix, not a vague warning — the audit shows the exact registry value that is wrong and what it should be.
The legitimate-macro exception is real, and it is where most environments fail. If one department genuinely needs macros, the answer is not to loosen the setting fleet-wide. It is to sign those macros, trust the publisher certificate, and keep everything else locked down. A signed-macro exception is auditable; a blanket Enable Content culture is not.
On a fleet, WinSentinel Pro rolls the same check up across every machine, so the one workstation where a macro setting was loosened for a support ticket shows up as drift instead of hiding until the next phishing wave finds it.
What still gets through
No macro policy is complete. Signed macros from a compromised publisher, Excel 4.0 macro sheets, and macros smuggled through trusted locations all bypass the standard controls, which is why the macro settings sit alongside — not instead of — attack surface reduction rules, Defender's script scanning, and keeping Office patched. But the phishing attachment, the oldest delivery mechanism in the book, is stopped cold by two settings that take five minutes to apply and an audit to keep honest.
A user clicking Enable Content is not a user error. It is a control that was never set.