Microsoft Office Macro Security

Download ACSC Protect Notice Microsoft Office Macro Security (1MB PDF), updated December 2016
First published 2012; updated December 2016

Table of contents


  1. Microsoft Office applications can execute macros to automate routine tasks. However, macros can contain malicious code resulting in unauthorised access to sensitive information as part of a targeted cyber intrusion.
  2. This document has been developed by the Australian Signals Directorate (ASD) to introduce approaches that can be applied by organisations to secure systems against malicious macros while balancing both their business and security requirements.
  3. The names and locations of group policy settings used in this document are taken from Microsoft Office 2013; some slight differences may exist for earlier or later versions of Microsoft Office.


  1. The Australian Cyber Security Centre (ACSC) has seen an increasing number of attempts to compromise organisations using malicious macros.
  2. Adversaries have been observed using social engineering techniques to entice users into executing malicious macros in Microsoft Office files. The purpose of these malicious macros can range from cybercrime to more sophisticated exploitation attempts.
  3. By understanding the business requirements for the use of macros, and applying the recommendations in this document, organisations can effectively manage the risk of allowing macros in their IT environments.

Macros explained

What are macros?

  1. Microsoft Office files can contain embedded code (known as a macro) written in the Visual Basic for Applications (VBA) programming language.
  2. A macro can contain a series of commands that can be coded or recorded, and replayed at a later time to automate repetitive tasks. Macros are powerful tools that can be easily created by novice users to greatly improve their productivity. However, adversaries can also create macros to perform a variety of malicious activities, such as assisting to compromise workstations in order to exfiltrate or deny access to sensitive information.

How are macros verified and trusted?

  1. Microsoft Office has both trusted document and trusted location functions. Once trusted documents or trusted locations are defined, macros in trusted documents or macros in Microsoft Office files stored in trusted locations automatically execute when the Microsoft Office files are opened. While the use of trusted documents is discouraged, trusted locations when implemented in a controlled manner can allow organisations to appropriately balance both their business and security requirements.
  2. Microsoft Office applications allow developers to include information about themselves and their macro code by digitally signing their macros. The certificate that is used to create a signed macro confirms that the macro originated from the signatory, while the signature itself confirms that the macro has not been altered. Digital certificates can be self-generated by users, obtained from a commercial certificate authority or obtained from an organisation’s security administrator if they operate their own certificate authority.

How to determine which macros to trust

  1. To manage the use of macros within an organisation, all macros created by users or third parties should be reviewed by an independent party to the developer and assessed to be safe before being approved for use within the organisation.
  2. When assessing whether macros are safe or not, assessors should ask themselves the following questions:
    1. Is there a business requirement for a particular macro?
    2. Has the macro been developed or provided by a trusted party?
    3. Has the macro been validated by a trustworthy and technically skilled party?
    4. Has the macro been signed by an approved certificate authority?

Keep reading Securing systems against malicious macros in ACSC Protect Notice Microsoft Office Macro Security (1MB PDF).

Further information

The Australian Government Information Security Manual (ISM) assists in the protection of official government information that is processed, stored or communicated by Australian government systems.

The Strategies to Mitigate Cyber Security Incidents complements the advice in the ISM.


Australian government customers with questions regarding this advice can contact ASD Advice and Assistance.

Australian businesses and other private sector organisations seeking further information should contact CERT Australia.