Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is a Macro Virus?

A macro virus lives in the automation language built into office documents, which is why a file that looks like an invoice can execute code the moment someone enables editing.

Illustration for the cybersecurity term Macro Virus
Home / Blog / Cybersecurity Terms / What Is a Macro Virus?
17 November 2026

What Is a Macro Virus?

What Is a Macro Virus?

A macro virus is malicious code written in the scripting language embedded in office applications, most often Visual Basic for Applications. It travels inside an apparently ordinary document and runs when the file is opened, or when the reader clicks the button that turns protections off. Unlike a compiled executable, it needs no installer and no exploit: the capability it abuses is a documented product feature intended for automating spreadsheets and reports.

Thirty Years of the Same Idea

Concept arrived in 1995 as the first macro virus to spread widely, infecting Word’s global template so that every document saved afterwards carried it. Laroux did the same for Excel a year later. Melissa, released in March 1999, attached itself to outgoing mail through Outlook and spread quickly enough to force several large organisations to shut down their mail systems; its author, David L. Smith, was later convicted.

The technique then lay relatively quiet while macro security tightened, and returned around 2014 as the preferred delivery method for banking trojans and ransomware. Dridex and Emotet campaigns sent millions of documents with a yellow banner and a line of text asking the reader to enable content because the file was supposedly created in a newer version of Office. It worked for years because the instruction looked like a formatting problem rather than an attack.

How a Modern Maldoc Works

The macro itself is rarely the malware. It is a launcher, and a short one:

That second stage is where the capability lives, which is why a macro detection should be treated as the start of the chain rather than the whole of it. The patterns are the same ones described under loaders and droppers.

Attackers also hide the code from static examination. VBA stomping removes the readable source while leaving the compiled p-code that actually executes, so a tool that reads only the source sees an empty project. Excel 4.0 macro sheets, a legacy format predating VBA, were revived heavily in 2020 and 2021 because many security products did not parse them.

What Changed in 2022

Microsoft began blocking VBA macros by default in files carrying the mark of the web in July 2022, after a brief rollback. The effect was immediate and measurable: campaigns moved to ISO images, shortcut files, HTML smuggling, and one-time password-protected archives, all chosen because they strip or avoid that tag. Macro attacks did not disappear, they became selective, and they still succeed where the mark of the web is not applied, such as files arriving through internal file shares, synchronised cloud folders, or archive tools that do not propagate it.

Verify the behaviour rather than assuming it. Save a test document from email to a share, then open it from there, and check whether the block still applies.

Controlling Macros Properly

Blocking everything is usually unrealistic, because finance and operations teams often depend on automation someone wrote years ago. A workable position has four parts:

Detection should focus on what follows the document rather than the document itself. An Office application spawning a shell, a script host, or a signed binary that reaches the internet is a high-fidelity signal; it survives every change of obfuscation and every new file format. Reinforce it with user guidance that is specific: no legitimate sender needs you to enable content to read an invoice.

At Privia Security, our email security solutions filter weaponised documents and containers before they reach the mailbox, which remains the cheapest place to stop them. Pair that with phishing awareness, since the document is only ever as convincing as the message that carried it.

FAQ – Frequently Asked Questions

Are Macro Viruses Still a Threat in 2026?

Less than they were, but not gone. Default blocking of internet-sourced macros pushed most campaigns towards other delivery formats, yet macros still execute freely in files that reach a user without the mark of the web, including documents from internal shares, synchronised cloud storage, and some archive tools. Organisations with trusted locations or broad macro exceptions remain fully exposed.

Is It Safe to Enable Content on a Document From a Known Sender?

Treat the request itself as the warning sign. Compromised mailboxes send to their own contact lists, so familiarity proves little, and a legitimate document almost never needs macros enabled simply to be read. If automation is genuinely required, it should be signed and distributed through a trusted location, not requested by a banner the user is asked to dismiss.

What Is VBA Stomping?

It is a technique that deletes the readable VBA source code from a document while leaving the compiled p-code that Office actually runs. Tools which extract and inspect source see nothing suspicious, yet the macro still executes on open. Analysis has to target the p-code stream directly, and detection is better placed on the behaviour after execution than on the document contents.

Do Macro Viruses Affect LibreOffice or Google Docs?

Both support macro languages, so the risk is not exclusive to Microsoft Office, although attack volume is far lower because the installed base is smaller. Google Workspace runs Apps Script in the cloud rather than on the endpoint, which changes the exposure rather than removing it. Macro settings and add-on controls deserve the same review in any office suite you deploy.

Related Terms

You May Be Interested In These

What Is the HTTP/2 Rapid Reset Attack?

Cybersecurity Terms

17 November 2026

What Is the HTTP/2 Rapid Reset Attack?

Read More
How Do You Report Security to the Board?

Cybersecurity Terms

17 November 2026

How Do You Report Security to the Board?

Read More
What Are HART and WirelessHART?

Cybersecurity Terms

17 November 2026

What Are HART and WirelessHART?

Read More