Live Active security incident? Get immediate response
MITRE ATT&CK® Technique

T1221: Template Injection

Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts. For example, Microsoft’s Office Open XML (OOXML) specification defines an XML-based format for Office documents (.docx, xlsx, .pptx) to replace older binary formats (.doc, .xls, .ppt). OOXML files are packed together ZIP archives compromised of various XML files, referred to as parts, containing properties that collectively define how a document is rendered.[1]

Properties within parts may reference shared public resources accessed via online URLs. For example, template properties may reference a file, serving as a pre-formatted document blueprint, that is fetched when the document is loaded.

Adversaries may abuse these templates to initially conceal malicious code to be executed via user documents. Template references injected into a document may enable malicious payloads to be fetched and executed when the document is loaded.[2] These documents can be delivered via other techniques such as Phishing and/or Taint Shared Content and may evade static detections since no typical indicators (VBA macro, script, etc.) are present until after the malicious payload is fetched.[3] Examples have been seen in the wild where template injection was used to load malicious code containing an exploit.[4]

Adversaries may also modify the *\template control word within an .rtf file to similarly conceal then download malicious code. This legitimate control word value is intended to be a file destination of a template file resource that is retrieved and loaded when an .rtf file is opened. However, adversaries may alter the bytes of an existing .rtf file to insert a template control word field to include a URL resource of a malicious payload.[5][6]

This technique may also enable Forced Authentication by injecting a SMB/HTTPS (or other credential prompting) URL and triggering an authentication attempt.[7][8][9]

EnterpriseT1221TechniqueObject v2.0 Modified
Glexia's Take

Analyst context for executives and security teams

Analyst confidence High

Template Injection matters because a seemingly ordinary Office Open XML or RTF document can contain an external template reference that pulls content after the user opens it. That makes the risk less about a visible macro in the original file and more about whether the organization can detect documents that reach out to remote resources, fetch code, or trigger credential prompts. For executives, this is a Windows document-handling and identity-exposure issue: a document can become the point where malware delivery or forced authentication begins.

Executive priority

Prioritize this where business users routinely receive Office or RTF documents from outside parties, where Windows endpoints have broad outbound access, or where captured credentials could affect sensitive systems. Leadership should ask whether email, endpoint, network, and identity teams can show evidence for external template fetching and SMB/HTTPS authentication attempts from user workstations. This technique is also relevant to audit and incident readiness because static file scanning alone may miss the risky content until the document retrieves its remote template.

Technical view

ATT&CK lists this as a Windows technique under the stealth tactic. Defenders should validate controls against OOXML documents that contain external template references and RTF files with modified template control words. Since the official ATT&CK object provides no detection text, coverage should be tested against the related detection strategy DET0566 and local telemetry. SOC and IR teams should correlate suspicious documents with outbound HTTP/HTTPS or SMB activity, credential-prompting behavior, and any subsequent payload retrieval or execution. Relationship context shows use by multiple campaigns, groups, and Windows malware families, but those relationships should guide threat modeling rather than be treated as evidence of current activity in a specific environment.

Likely telemetry

  • Email security and file gateway records for Office Open XML and RTF attachments or shared documents
  • Endpoint file metadata and content inspection results for OOXML ZIP/XML parts and RTF template fields
  • Endpoint process and application activity when Office or document viewers open files
  • Outbound web proxy, DNS, and firewall logs for remote template URLs requested by user workstations
  • SMB and HTTPS authentication logs showing unexpected credential attempts initiated after document open

Detection direction

  • Do not rely only on static indicators such as embedded VBA macros or scripts; the ATT&CK description notes the malicious content may not be present until fetched remotely.
  • Validate whether DET0566 or equivalent analytics inspect OOXML internal XML parts and RTF template control words for external resource references.
  • Tune network detections for Office/document-viewer initiated outbound requests to unusual external URLs, especially when followed by downloads, authentication prompts, or execution activity.
  • Review SMB and HTTPS authentication attempts from user endpoints after document access to identify possible Forced Authentication behavior related to this technique.
  • Account for false positives from legitimate corporate templates and document management workflows by baselining approved template locations and expected domains.

Mitigation priorities

  • Start with user training focused on recognizing and reporting suspicious documents, consistent with M1017, because delivery can occur through phishing or shared content.
  • Use network intrusion prevention or boundary controls, consistent with M1031, to block or alert on suspicious template retrieval and known-bad traffic patterns.
  • Reduce attack surface by disabling or removing unnecessary document features, programs, or legacy handling paths where business requirements allow, consistent with M1042.
  • Maintain antivirus/antimalware coverage on Windows endpoints, consistent with M1049, while recognizing that this technique may attempt to defer malicious content retrieval until after the document is opened.
  • Define approved external template sources and investigate exceptions rather than treating all remote template use as malicious.
Analyst notes and limits

The most important defensive question is whether the organization can connect three facts: a user opened a document, the document referenced a remote template or RTF template destination, and the endpoint then reached out or attempted authentication. The relationship set includes campaigns, groups, and software that use this technique, including Frankenstein, Operation Dream Job, APT28, Dragonfly, Gamaredon Group, DarkHydrus, Tropic Trooper, Inception, Confucius, MirrorFace, Chaes, and WarzoneRAT. Use those relationships for prioritization and threat intelligence enrichment, not as proof of local compromise.

The official ATT&CK object does not provide detection logic, data sources, procedures, or detailed mitigations beyond relationships to DET0566 and mitigations M1017, M1031, M1042, and M1049. Local document workflows, approved template infrastructure, endpoint logging depth, and identity telemetry determine practical detection quality. This take does not assert active exploitation or organization-specific exposure.

Official MITRE ATT&CK definition

Template Injection

Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts. For example, Microsoft’s Office Open XML (OOXML) specification defines an XML-based format for Office documents (.docx, xlsx, .pptx) to replace older binary formats (.doc, .xls, .ppt). OOXML files are packed together ZIP archives compromised of various XML files, referred to as parts, containing properties that collectively define how a document is rendered.[1]

Properties within parts may reference shared public resources accessed via online URLs. For example, template properties may reference a file, serving as a pre-formatted document blueprint, that is fetched when the document is loaded.

Adversaries may abuse these templates to initially conceal malicious code to be executed via user documents. Template references injected into a document may enable malicious payloads to be fetched and executed when the document is loaded.[2] These documents can be delivered via other techniques such as Phishing and/or Taint Shared Content and may evade static detections since no typical indicators (VBA macro, script, etc.) are present until after the malicious payload is fetched.[3] Examples have been seen in the wild where template injection was used to load malicious code containing an exploit.[4]

Adversaries may also modify the *\template control word within an .rtf file to similarly conceal then download malicious code. This legitimate control word value is intended to be a file destination of a template file resource that is retrieved and loaded when an .rtf file is opened. However, adversaries may alter the bytes of an existing .rtf file to insert a template control word field to include a URL resource of a malicious payload.[5][6]

This technique may also enable Forced Authentication by injecting a SMB/HTTPS (or other credential prompting) URL and triggering an authentication attempt.[7][8][9]

View the same entry on attack.mitre.org (MITRE-hosted reference; in-page links above use the Glexia ATT&CK library.)

Glexia analysis

How security teams should use this page

Treat this object as behavior context, not an attribution claim. Validate the related groups, software, data sources, and mitigations against official ATT&CK relationships and your own telemetry before making control-coverage decisions.

Associated objects

Groups, software, and campaigns

Group Enterprise

G0035: Dragonfly

Dragonfly is a cyber espionage group that has been attributed to Russia's Federal Security Service (FSB) Center 16.[1][2] Active since at least 2010, Dragonfly has targeted defense and aviation companies, government entities, companies related to industrial control systems, and critical infrastructure sectors worldwide through supply chain, spearphishing, and drive-by compromise attacks.[3][4][5][6][7][8][9]

Group Enterprise

G0142: Confucius

Confucius is a cyber espionage group that has primarily targeted military personnel, high-profile personalities, business persons, and government organizations in South Asia since at least 2013. Security researchers have noted similarities between Confucius and Patchwork, particularly in their respective custom malware code and targets.[1][2][3]

Group Enterprise

G0007: APT28

APT28 is a threat group that has been attributed to Russia's General Staff Main Intelligence Directorate (GRU) 85th Main Special Service Center (GTsSS) military unit 26165.[1][2] This group has been active since at least 2004.[3][4][5][6][7][8][9][10][11][12][13]

APT28 reportedly compromised the Hillary Clinton campaign, the Democratic National Committee, and the Democratic Congressional Campaign Committee in 2016 in an attempt to interfere with the U.S. presidential election.[5] In 2018, the US indicted five GRU Unit 26165 officers associated with APT28 for cyber operations (including close-access operations) conducted between 2014 and 2018 against the World Anti-Doping Agency (WADA), the US Anti-Doping Agency, a US nuclear facility, the Organization for the Prohibition of Chemical Weapons (OPCW), the Spiez Swiss Chemicals Laboratory, and other organizations.[14] Some of these were conducted with the assistance of GRU Unit 74455, which is also referred to as Sandworm Team.

Group Enterprise

G0047: Gamaredon Group

Gamaredon Group is a suspected Russian cyber espionage group that has targeted military, law enforcement, judiciary, non-profit, and non-governmental organizations in Ukraine since at least 2013. The name Gamaredon Group derives from a misspelling of the word "Armageddon," found in early campaigns.[1][2][3][4][5]

In November 2021, the Ukrainian government publicly attributed Gamaredon Group to Russia’s Federal Security Service (FSB) Center 18, an assessment later supported by multiple independent cybersecurity researchers. [6][5]

Group Enterprise

G0100: Inception

Inception is a cyber espionage group active since at least 2014. The group has targeted multiple industries and governmental entities primarily in Russia, but has also been active in the United States and throughout Europe, Asia, Africa, and the Middle East.[1][2][3]

Group Enterprise

G1054: MirrorFace

MirrorFace is a People's Republic of China (PRC)-aligned cyberespionage actor believed to be a subgroup under the menuPass umbrella based on targeting, tools, and infrastructure overlaps. MirrorFace has been active since at least 2019, at first exclusively targeting Japanese organizations across the media, defense, diplomatic, financial, manufacturing, and academic sectors. Subsequent MirrorFace operations included targets in Central Europe and featured use of LODEINFO, HiddenFace, and UPPERCUT malware.[1][2][3][4][5][6]

Group Enterprise

G0079: DarkHydrus

DarkHydrus is a threat group that has targeted government agencies and educational institutions in the Middle East since at least 2016. The group heavily leverages open-source tools and custom payloads for carrying out attacks. [1] [2]

Malware Enterprise

S0631: Chaes

Chaes is a multistage information stealer written in several programming languages that collects login credentials, credit card numbers, and other financial information. Chaes was first observed in 2020, and appears to primarily target victims in Brazil as well as other e-commerce customers in Latin America.[1]

Windows
Malware Enterprise

S0670: WarzoneRAT

WarzoneRAT is a malware-as-a-service remote access tool (RAT) written in C++ that has been publicly available for purchase since at least late 2018.[1][2]

Windows
Campaign Enterprise

C0022: Operation Dream Job

Operation Dream Job was a cyber espionage operation likely conducted by Lazarus Group that targeted the defense, aerospace, government, and other sectors in the United States, Israel, Australia, Russia, and India. In at least one case, the cyber actors tried to monetize their network access to conduct a business email compromise (BEC) operation. In 2020, security researchers noted overlapping TTPs, to include fake job lures and code similarities, between Operation Dream Job, Operation North Star, and Operation Interception; by 2022 security researchers described Operation Dream Job as an umbrella term covering both Operation Interception and Operation North Star.[1][2][3][4]

Campaign Enterprise

C0001: Frankenstein

Frankenstein was described by security researchers as a highly-targeted campaign conducted by moderately sophisticated and highly resourceful threat actors in early 2019. The unidentified actors primarily relied on open source tools, including Empire. The campaign name refers to the actors' ability to piece together several unrelated open-source tool components.[1]

Relationship explorer

All related ATT&CK context

Mitigations

Mitigation direction

Change history

Object version and sync metadata

The fields below describe the current mirrored snapshot. When Glexia retains multiple ATT&CK source imports, you can open the table to compare the same object across releases (hashes and MITRE timestamps). For MITRE’s own release notes and roadmap, see ATT&CK resources — Updates .

ATT&CK release
19.1
Object version
2.0
Created
Modified
Raw hash
6652647257a2424b...
Imported snapshots across ATT&CK releases (1)
Release Bundle imported Object version Modified Status Raw hash
19.1 2.0 Current bundle 6652647257a2…
Raw source

Mirrored ATT&CK source object

The raw object is retained through the mirrored ATT&CK source bundle and object hash. The raw endpoint returns the exact object from the mirrored bundle when available.

Source references

External references and citations

MITRE external references are preserved separately from Glexia analysis so citations remain traceable to their original source records.

  1. [1]
    Microsoft Open XML July 2017

    Microsoft. (2014, July 9). Introducing the Office (2007) Open XML File Formats. Retrieved July 20, 2018.

    Open source URL
  2. [2]
    SANS Brian Wiltse Template Injection

    Wiltse, B.. (2018, November 7). Template Injection Attacks - Bypassing Security Controls by Living off the Land. Retrieved April 10, 2019.

    Open source URL
  3. [3]
    Redxorblue Remote Template Injection

    Hawkins, J. (2018, July 18). Executing Macros From a DOCX With Remote Template Injection. Retrieved October 12, 2018.

    Open source URL
  4. [4]
    MalwareBytes Template Injection OCT 2017

    Segura, J. (2017, October 13). Decoy Microsoft Word document delivers malware through a RAT. Retrieved July 21, 2018.

    Open source URL
  5. [5]
    Proofpoint RTF Injection

    Raggi, M. (2021, December 1). Injection is the New Black: Novel RTF Template Inject Technique Poised for Widespread Adoption Beyond APT Actors . Retrieved December 9, 2021.

    Open source URL
  6. [6]
    Ciberseguridad Decoding malicious RTF files

    Pedrero, R.. (2021, July). Decoding malicious RTF files. Retrieved November 16, 2021.

    Open source URL
  7. [7]
    Anomali Template Injection MAR 2018

    Intel_Acquisition_Team. (2018, March 1). Credential Harvesting and Malicious File Delivery using Microsoft Office Template Injection. Retrieved July 20, 2018.

    Open source URL
  8. [8]
    Talos Template Injection July 2017

    Baird, S. et al.. (2017, July 7). Attack on Critical Infrastructure Leverages Template Injection. Retrieved July 21, 2018.

    Open source URL
  9. [9]
    ryhanson phishery SEPT 2016

    Hanson, R. (2016, September 24). phishery. Retrieved July 21, 2018.

    Open source URL
  10. [10]
    mitre-attack T1221
    Open source URL
Source and licensing

Source: MITRE ATT&CK®. © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. MITRE ATT&CK and ATT&CK are registered trademarks of The MITRE Corporation. Glexia is not affiliated with or endorsed by MITRE.