MITRE ATT&CK T1221: Template Injection
When to use this skill
Use this skill when the task involves T1221, Template Injection, enterprise ATT&CK, TTP mapping, detection engineering, hunting, incident-response enrichment, control validation, or authorized adversary-emulation planning. Treat it as a defensive analysis aid: keep outputs focused on understanding, detecting, mitigating, and safely validating this ATT&CK technique.
Technique context
- ATT&CK domain: enterprise
- ATT&CK ID: T1221
- Technique name: Template Injection
- Type: technique
- ATT&CK URL: https://attack.mitre.org/techniques/T1221
- Tactics: stealth
- Platforms: Windows
- Required permissions: Not specified
- Effective permissions: Not specified
- Defenses bypassed: Not specified
ATT&CK description
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.(Citation: Microsoft Open XML July 2017)
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.(Citation: SANS Brian Wiltse Template Injection) 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.(Citation: Redxorblue Remote Template Injection) Examples have been seen in the wild where template injection was used to load malicious code containing an exploit.(Citation: MalwareBytes Template Injection OCT 2017)
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.(Citation: Proofpoint RTF Injection)(Citation: Ciberseguridad Decoding malicious RTF files)
This technique may also enable Forced Authentication by injecting a SMB/HTTPS (or other credential prompting) URL and triggering an authentication attempt.(Citation: Anomali Template Injection MAR 2018)(Citation: Talos Template Injection July 2017)(Citation: ryhanson phishery SEPT 2016)
Agent workflow
- Clarify scope: identify the system, asset class, log sources, cloud or endpoint platform, and whether the user wants triage, detection, coverage assessment, or safe emulation planning.
- Load bundled resources as needed: use
references/technique-profile.json for structured metadata, references/detection-and-mitigation.md for triage and telemetry guidance, references/known-threat-context.md for ATT&CK relationship context, and templates/ for repeatable outputs.
- Map observations to ATT&CK: compare the user's evidence to the ATT&CK description, tactics, platforms, and known procedure patterns before asserting a match.
- Produce defensive outputs: prioritize hypotheses, telemetry requirements, detection logic ideas, validation steps, containment guidance, and mitigations.
- Preserve uncertainty: distinguish confirmed evidence, plausible indicators, assumptions, and gaps. Recommend what to collect next.
- Stay safe: do not provide malware, credential theft, persistence, evasion, destructive automation, or unauthorized exploitation instructions. For adversary emulation, keep steps bounded to approved lab or control-validation contexts and omit operational abuse details.
Bundled resources
references/technique-profile.json: machine-readable ATT&CK metadata for this technique.
references/detection-and-mitigation.md: detection notes, telemetry checklist, triage questions, mitigation candidates, and false-positive considerations.
references/known-threat-context.md: ATT&CK relationship context with attribution cautions.
templates/detection-brief.md: detection engineering brief template.
templates/hunt-plan.md: threat hunt plan template.
templates/incident-response-note.md: incident response note template.
templates/coverage-assessment.md: ATT&CK coverage assessment template.
scripts/render_brief.py: local helper that renders a Markdown defensive brief from technique-profile.json.
assets/output-schema.json: JSON schema for structured technique analysis outputs.
To generate a quick brief, run python scripts/render_brief.py --output brief.md from inside this skill directory, or adapt the templates directly.
Detection guidance
No ATT&CK detection guidance was present in the source STIX object.
Useful telemetry and data sources
- Not specified in the STIX object.
Mitigations to consider
- Antivirus/Antimalware
- Disable or Remove Feature or Program
- Network Intrusion Prevention
- User Training
Known threat context
Use these examples only as contextual leads, not as proof that an observed event is this technique:
- APT28 (intrusion-set)
- Chaes (malware)
- Confucius (intrusion-set)
- DarkHydrus (intrusion-set)
- Dragonfly (intrusion-set)
- Frankenstein (campaign)
- Gamaredon Group (intrusion-set)
- Inception (intrusion-set)
- MirrorFace (intrusion-set)
- Operation Dream Job (campaign)
- Tropic Trooper (intrusion-set)
- WarzoneRAT (malware)
Recommended output pattern
When responding with this skill, structure the answer as:
- Assessment: whether the evidence supports this ATT&CK mapping and why.
- Evidence: specific indicators, logs, behaviors, and assumptions.
- Detection: telemetry sources, analytic logic, and tuning considerations.
- Response: containment, eradication, recovery, and validation actions.
- Coverage gaps: missing logs, sensors, controls, or environmental details.
- References: include the ATT&CK URL and any user-provided evidence references.
ATT&CK contributors
- Brian Wiltse @evalstrings
- Michael Raggi @aRtAGGI
- Patrick Campbell, @pjcampbe11
1---2name: attack-ent-t1221-template-injection3description: "Analyze MITRE ATT&CK T1221 Template Injection in the enterprise matrix. Use for TTP triage, detection engineering, hunting, defensive emulation planning, mitigations, incident response mapping, ATT&CK coverage, or questions mentioning T1221, Template Injection, or enterprise ATT&CK. Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts."4license: MITRE ATT&CK Terms of Use apply to ATT&CK-derived content. See https://attack.mitre.org/resources/terms-of-use/5metadata:6 source: https://skillmd.com/skills/santosomar/attack-ent-t1221-template-injection7 upstream: mitre-attack/attack-stix-data8 domain: enterprise9 attack_id: T122110 attack_stix_id: attack-pattern--dc31fe1e-d722-49da-8f5f-92c7b5aff53411 attack_version: "2.0"12 attack_modified: "2026-04-15T22:44:24.229Z"13---1415# MITRE ATT&CK T1221: Template Injection1617## When to use this skill1819Use this skill when the task involves T1221, Template Injection, enterprise ATT&CK, TTP mapping, detection engineering, hunting, incident-response enrichment, control validation, or authorized adversary-emulation planning. Treat it as a defensive analysis aid: keep outputs focused on understanding, detecting, mitigating, and safely validating this ATT&CK technique.2021## Technique context2223- ATT&CK domain: enterprise24- ATT&CK ID: T122125- Technique name: Template Injection26- Type: technique27- ATT&CK URL: https://attack.mitre.org/techniques/T122128- Tactics: stealth29- Platforms: Windows30- Required permissions: Not specified31- Effective permissions: Not specified32- Defenses bypassed: Not specified3334## ATT&CK description3536Adversaries 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.(Citation: Microsoft Open XML July 2017)3738Properties 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.3940Adversaries 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.(Citation: SANS Brian Wiltse Template Injection) These documents can be delivered via other techniques such as [Phishing](https://attack.mitre.org/techniques/T1566) and/or [Taint Shared Content](https://attack.mitre.org/techniques/T1080) and may evade static detections since no typical indicators (VBA macro, script, etc.) are present until after the malicious payload is fetched.(Citation: Redxorblue Remote Template Injection) Examples have been seen in the wild where template injection was used to load malicious code containing an exploit.(Citation: MalwareBytes Template Injection OCT 2017)4142Adversaries may also modify the <code>*\template</code> 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.(Citation: Proofpoint RTF Injection)(Citation: Ciberseguridad Decoding malicious RTF files)4344This technique may also enable [Forced Authentication](https://attack.mitre.org/techniques/T1187) by injecting a SMB/HTTPS (or other credential prompting) URL and triggering an authentication attempt.(Citation: Anomali Template Injection MAR 2018)(Citation: Talos Template Injection July 2017)(Citation: ryhanson phishery SEPT 2016)4546## Agent workflow47481. Clarify scope: identify the system, asset class, log sources, cloud or endpoint platform, and whether the user wants triage, detection, coverage assessment, or safe emulation planning.492. Load bundled resources as needed: use `references/technique-profile.json` for structured metadata, `references/detection-and-mitigation.md` for triage and telemetry guidance, `references/known-threat-context.md` for ATT&CK relationship context, and `templates/` for repeatable outputs.503. Map observations to ATT&CK: compare the user's evidence to the ATT&CK description, tactics, platforms, and known procedure patterns before asserting a match.514. Produce defensive outputs: prioritize hypotheses, telemetry requirements, detection logic ideas, validation steps, containment guidance, and mitigations.525. Preserve uncertainty: distinguish confirmed evidence, plausible indicators, assumptions, and gaps. Recommend what to collect next.536. Stay safe: do not provide malware, credential theft, persistence, evasion, destructive automation, or unauthorized exploitation instructions. For adversary emulation, keep steps bounded to approved lab or control-validation contexts and omit operational abuse details.5455## Bundled resources5657- `references/technique-profile.json`: machine-readable ATT&CK metadata for this technique.58- `references/detection-and-mitigation.md`: detection notes, telemetry checklist, triage questions, mitigation candidates, and false-positive considerations.59- `references/known-threat-context.md`: ATT&CK relationship context with attribution cautions.60- `templates/detection-brief.md`: detection engineering brief template.61- `templates/hunt-plan.md`: threat hunt plan template.62- `templates/incident-response-note.md`: incident response note template.63- `templates/coverage-assessment.md`: ATT&CK coverage assessment template.64- `scripts/render_brief.py`: local helper that renders a Markdown defensive brief from `technique-profile.json`.65- `assets/output-schema.json`: JSON schema for structured technique analysis outputs.6667To generate a quick brief, run `python scripts/render_brief.py --output brief.md` from inside this skill directory, or adapt the templates directly.6869## Detection guidance7071No ATT&CK detection guidance was present in the source STIX object.7273## Useful telemetry and data sources7475- Not specified in the STIX object.7677## Mitigations to consider7879- Antivirus/Antimalware80- Disable or Remove Feature or Program81- Network Intrusion Prevention82- User Training8384## Known threat context8586Use these examples only as contextual leads, not as proof that an observed event is this technique:8788- APT28 (intrusion-set)89- Chaes (malware)90- Confucius (intrusion-set)91- DarkHydrus (intrusion-set)92- Dragonfly (intrusion-set)93- Frankenstein (campaign)94- Gamaredon Group (intrusion-set)95- Inception (intrusion-set)96- MirrorFace (intrusion-set)97- Operation Dream Job (campaign)98- Tropic Trooper (intrusion-set)99- WarzoneRAT (malware)100101## Recommended output pattern102103When responding with this skill, structure the answer as:104105- Assessment: whether the evidence supports this ATT&CK mapping and why.106- Evidence: specific indicators, logs, behaviors, and assumptions.107- Detection: telemetry sources, analytic logic, and tuning considerations.108- Response: containment, eradication, recovery, and validation actions.109- Coverage gaps: missing logs, sensors, controls, or environmental details.110- References: include the ATT&CK URL and any user-provided evidence references.111112## ATT&CK contributors113114- Brian Wiltse @evalstrings115- Michael Raggi @aRtAGGI116- Patrick Campbell, @pjcampbe11