macro virus

term

security

Kept 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

← Back to M Back to the glossary