macro virus
termKept in this browser · My desk
A virus written in the macro language of an office application, which travels inside documents and templates and runs when the document is opened.
Macro viruses moved the host from the program to the document. Concept, written in Word 6's macro language in 1995, copied itself into Word's global template and from there into every document saved, on Windows and Macintosh alike, so that, in F-Secure's words, its effective operating system was Word. Melissa in 1999 added mass mailing. Two decades later the same instruction, enable macros, was how Emotet's documents installed it, until Microsoft blocked macros in files from the internet by default in 2022.
Concept was a demonstration. Its macros infected the global template NORMAL.DOT on the first opened document; afterwards every document saved with Save As carried it to the next machine. Its macro named PayLoad contained only the remark That's enough to prove my point, and it was never executed. F-Secure records it as extremely widespread from 1995 to 1997. The template is still the mechanism: MITRE ATT&CK (Adversarial Tactics, Techniques, and Common Knowledge) catalogues Office Template Macros as sub-technique T1137.001, a way to persist by planting macros in the base template that loads with the application, Word's Normal.dotm or Excel's Personal.xlsb, and lists the MuddyWater group among those that have used Normal.dotm.
Why documents became hosts. The 2005 malware guide of the National Institute of Standards and Technology (NIST), Special Publication (SP) 800-83, called macro viruses the most prevalent and successful type of virus at the time: they use the macro language that applications such as Microsoft Office provide to automate tasks, they spread quickly because people share documents, and once they infect the template every document created or opened with it is infected too. Its examples were Concept, Marker and Melissa. Because they are source code, interpreted viruses are easy to read, modify and redistribute, so a single one often has dozens of variants with trivial changes. NIST files macro viruses among the interpreted viruses, beside scripting viruses, which are written for a service of the operating system rather than an application, and the point is the same for both: the host is data that a powerful interpreter will run. Vendors' names record the host: in the scheme Microsoft follows, WM marks Word 95 macros, W97M Word 97 to 2010 macros, X97M Excel macros, XF Excel formulas and O97M macros that affect Word, Excel and PowerPoint together.
Melissa made it a crime story. According to the Federal Bureau of Investigation (FBI), in late March 1999 David Lee Smith used a hijacked America Online (AOL) account to post a Word document to the alt.sex newsgroup promising passwords to adult websites; it began spreading on 26 March, because when readers opened it in Word its macro took over Outlook and mailed itself to the first 50 addresses in their mailing lists, at an estimated cost of $80 million in clean-up and repair. He pleaded guilty on 9 December 1999, in federal court to knowingly spreading a computer virus with the intent to cause damage and in state court to computer-related theft, and on 1 May 2002, the United States Department of Justice announced, he was sentenced to 20 months in federal prison, three years of supervised release, 100 hours of community service and a $5,000 fine, well below the guideline range of 46 to 57 months because of his cooperation in other investigations.
What followed made documents the most common delivery vehicle for malware. Emotet, described by Europol in 2021, sent invoices, shipping notices and COVID-19 updates whose Word documents asked the reader to enable macros so that the hidden code could install the loader. Microsoft's documentation states plainly that Visual Basic for Applications (VBA) macros are a common way for malicious actors to gain access and deploy malware and ransomware.
The defence was a change of default. From 12 April 2022 in the preview channel and 27 July 2022 in the Current Channel, Office blocks VBA macros in files marked as coming from the internet, and the same behaviour can be enforced by policy. Microsoft's page adds the details: the change applies to Office on Windows, to Access, Excel, PowerPoint, Project, Publisher, Visio and Word; it reached the Monthly Enterprise Channel on 11 October 2022, the Semi-Annual Enterprise Channel on 10 January 2023, Publisher in February 2023 and Project in August 2024; the decision rests on the Mark of the Web, an attribute that records that a file came from the internet; and files an organization does trust are allowed by location, by trusted publisher signature or by removing the mark from a single file. The Block macros from running in Office files from the Internet policy existed before, and Microsoft recommends it as part of the security baseline for Microsoft 365 Apps.
What goes wrong, and what came next. Proofpoint, a mail-security vendor, reported in July 2022 that the use of VBA and Excel 4.0 (XL4) macros in the campaigns it tracks fell about 66 percent from October 2021 to June 2022, and that attackers moved to disk-image and archive containers and Windows Shortcut (LNK) files; Proofpoint explains that a document extracted from such a container did not carry the internet mark that the container itself had. The lesson is that the block depends on the mark being there. Keep the default, extend it with the policy, and treat any request to enable content in a received document as the warning sign it has been since 1995. Neighbours: macro viruses are the interpreted branch of the computer virus, Melissa was the macro that opened the worm era, and modern loaders still arrive in documents.
Also known as: macro malware, document virus, word macro virus, vírus de macro
Sources
- F-Secure, Concept description (read 2026-11-23): Word 6 macro virus; infects the global template NORMAL.DOT and every document saved with Save As; works in Word for Windows and Macintosh; its PayLoad macro says 'That's enough to prove my point' and never runs; extremely widespread 1995 to 1997
- NIST SP 800-83 Revision 1, July 2013 (read 2026-11-23): interpreted viruses include macro viruses, which infect application documents and templates, and scripting viruses
- Microsoft Learn, Macros from the internet are blocked by default in Office (read 2026-11-23): VBA macros are a common way to deploy malware and ransomware; the block on macros in files from the internet rolled out from 12 April 2022 (preview) and 27 July 2022 (Current Channel)
- Europol, Emotet disrupted, 27 January 2021, read in a browser (read 2026-11-23): Emotet's Word documents prompted the user to enable macros so that the hidden code could install the malware
- MITRE ATT&CK, T1137.001 Office Template Macros, sub-technique of T1137 Office Application Startup, tactic Persistence, created 7 November 2019, version 1.2 (read 2026-11-23): malicious macros inserted into a base template run when the Office application starts; Word's Normal.dotm and Excel's Personal.xlsb in XLSTART; macros may need to be enabled depending on policy; MuddyWater has used a Word template, Normal.dotm, for persistence
- Peter Mell, Karen Kent and Joseph Nusbaum, NIST SP 800-83, Guide to Malware Incident Prevention and Handling, November 2005, withdrawn July 2013 (read 2026-11-23): macro viruses are the most prevalent and successful type of virus; they use the macro programming capabilities of packages such as Microsoft Office, spread quickly because users share documents and infect the template, so that every document created or opened with it is infected; Concept, Marker and Melissa as examples; interpreted viruses are easy to modify and often have dozens of variants; scripting viruses use a language understood by an OS service such as the Windows Scripting Host
- Federal Bureau of Investigation, The Melissa Virus: An $80 Million Cyber Crime in 1999 Foreshadowed Modern Threats, 25 March 2019 (read 2026-11-23): in late March 1999 David Lee Smith hijacked an AOL account to post a file to the alt.sex newsgroup promising passwords to adult websites; opened in Word, it began spreading on 26 March; a macro hijacked Outlook and sent messages to the first 50 addresses in the victim's mailing lists; an estimated $80 million for clean-up and repair
- US Department of Justice, US Attorney for the District of New Jersey, Creator of Melissa Computer Virus Sentenced to 20 Months in Federal Prison, 1 May 2002 (read 2026-11-23): David L. Smith, 34, of Aberdeen Township; 20 months in federal prison, three years of supervised release, a $5,000 fine and 100 hours of community service; guilty pleas of 9 December 1999 in federal court (knowingly spreading a computer virus with the intent to cause damage, maximum five years and $250,000) and state court (computer-related theft); acknowledged more than $80 million in damage; guideline range of 46 to 57 months, downward departure for cooperation in other investigations
- Microsoft Learn, Malware names (read 2026-11-23): detections named by the CARO scheme with a platform field that records macro hosts: WM for Word 95 macros, W97M for Word 97 to 2010 macros, X97M for Excel 97 to 2010 macros, XM for Excel 95 macros, XF for Excel formulas, O97M for Office macros affecting Word, Excel and PowerPoint, A97M, PP97M and V5M
- Selena Larson, Daniel Blackford and the Proofpoint Threat Research Team, How Threat Actors Are Adapting to a Post-Macro World, Proofpoint, 28 July 2022 (read 2026-11-23): use of VBA and XL4 macros in Proofpoint's campaign data fell about 66 percent from October 2021 through June 2022 after Microsoft announced blocking XL4 (October 2021) and VBA (February 2022) macros by default; attackers moved to ISO and RAR containers and Windows Shortcut (LNK) files; the Mark of the Web (Zone.Identifier) applied to a downloaded container was not carried by a document extracted from it