Join our Newsletter — 33% off our NHI Course
Home› FAQ› Threats, Abuse & Incident Response› How do attackers use VBA Stomping?
Threats, Abuse & Incident Response

How do attackers use VBA Stomping?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 18, 2026 Domain: Threats, Abuse & Incident Response

Attackers use VBA Stomping to strip or replace visible VBA source code in an Office document while leaving compiled macro content intact. That can hide malicious logic from casual inspection and some analysis tools. Defenders should inspect macro-enabled files for source and compiled-code mismatches and treat hidden or missing VBA source as suspicious.

How attackers hide VBA with stomping

vba stomping is an evasion technique, not a new payload type. The attacker keeps the macro’s compiled behavior inside the Office file while removing or replacing the visible source, so a reviewer may see little or no VBA code even though the macro can still run. That makes the document look cleaner than it is and slows casual inspection.

At a practical level, this means the visible editor view is not a reliable indicator of what the macro will execute. Analysts should assume that a macro-enabled file can contain hidden logic even when the source pane is empty, incomplete, or nonsensical, and they should verify the compiled content rather than trusting what Office shows by default. For broader malware tradecraft and evasion patterns, Malware Guide is the relevant starting point.

What hides from defenders, and what still remains

The technique works by separating what a human can read from what the document can execute. The visible VBA project may be stripped, blanked, or replaced, but the compiled macro stream remains intact enough for Office to interpret at runtime. That is why the file can pass a superficial review while still carrying malicious automation, downloader logic, or document-based launch code.

This is useful to attackers because many triage workflows still begin with a quick look in the VBA editor or an automated source scan. If the tool only inspects exposed source text, the document can appear low risk even though the executable macro body is preserved. One useful reference point for how adversaries hide payloads and stage execution is The State of NHI & AI Agent Breach Report 2026, which covers attacker tradecraft around hidden access paths and abuse of trusted execution.

What a defender should verify in suspicious Office files

Detection should focus on mismatch, not just presence. A macro-enabled document is suspicious when the file claims to contain VBA but the visible source is absent, truncated, or inconsistent with the compiled project structure. That kind of mismatch is especially important when the file arrives as an attachment, comes from an untrusted sender, or is used to start a multi-stage infection chain.

Good analysis usually requires checking both the user-visible source and the underlying compiled macro content, then comparing them for gaps or unexpected structure. If the source is missing or clearly altered, treat that as an indicator of concealment rather than as proof of harmlessness. In practice, defenders should also retain the file, the extracted metadata, and the inspection artefacts so they can compare repeated samples or hunt for related documents.

Risk and Threat Considerations

VBA Stomping increases the chance that a malicious document will survive initial review. The main risk is analyst blind spots: a file may look empty or benign in source form while still executing hidden macro logic, which creates a gap between what is inspected and what actually runs.

Failure mechanism: The attacker removes or corrupts the readable VBA source while preserving compiled code, so source-based triage and some static scanners miss the malicious behavior.

Impact: The document can be misclassified as low risk, allowed deeper into the environment, and given a larger opportunity to trigger macro execution, payload retrieval, or follow-on compromise.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
MITRE ATT&CKT1027 — Obfuscated Files or InformationVBA Stomping hides readable macro source while preserving executable content.
T1204 — User ExecutionMalicious Office documents rely on user opening or enabling the file to trigger macros.
Recommendation — Hunt for source and compiled-code mismatches as file obfuscation and concealment. Inspect macro-enabled attachments before user execution can occur.
CIS Controls v8CIS-10 — Data RecoverySuspicious document handling and recovery depend on safe response to malicious file exposure.
Recommendation — Quarantine suspicious Office files and preserve copies for analysis and recovery.

Practitioner Guidance

What to verify: Confirm whether the file’s visible VBA source matches the compiled macro content, and treat a source and compiled-code mismatch as a detection signal rather than an anomaly to ignore. If the document is macro-enabled but the source is missing, assume concealment until proven otherwise.

What to prioritise: Put suspicious Office files through detonation or deeper static inspection before trusting a quick editor view, especially when the file came from email, a shared drive, or an external partner. Source absence alone is not enough to prove maliciousness, but source absence plus compiled content is enough to justify escalation.

Practitioner takeaway: The key judgment is to inspect the executable reality of the document, not the readable façade, because VBA Stomping is designed to defeat the first glance.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 18, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org