Several of the most effective Windows defences against downloaded malware only work if a file still carries its Mark of the Web. Mark of the Web (MOTW) is a small tag Windows writes to files that arrive from the internet, and SmartScreen, Office Protected View, Office internet macro blocking and Smart App Control all read it. When the tag is lost, through a container format, a non-NTFS volume or a careless exception, those controls quietly step aside. This guide explains how MOTW is stored, which controls depend on it, how it propagates through archives and disk images, the bypass classes defenders should know at a conceptual level, and how to enforce and monitor it. It is for Windows endpoint engineers and SOC analysts.
Key takeaways
- MOTW is an NTFS alternate data stream: a stream named Zone.Identifier holds a ZoneId, and a value of 3 means the file came from the Internet zone.
- Many controls depend on it: SmartScreen reputation checks, Protected View, the Office block on internet macros and Smart App Control all key off the tag.
- Containers are the weak point: ISO, VHD and some archive formats have been used to deliver files that lose the tag after mounting or extraction, which ATT&CK tracks as T1553.005 Mark-of-the-Web Bypass.
- Enforce with policy, not defaults: keep zone information preserved, hide the Unblock option, set the Office internet macro policy to Enabled, block container types at gateways and turn on the relevant ASR rules.
- Hunt for files without a tag: executables and scripts launched from mounted images, extracted archive folders or removable media with no Zone.Identifier are a high-value detection.
What Mark of the Web is
When a browser, email client or other application saves a file from an untrusted location, it writes an alternate data stream named Zone.Identifier to the file. The stream contains a [ZoneTransfer] section with a ZoneId value; on Windows 10 and later it can also record the source and referrer URLs. Applications should apply the tag through the Windows IAttachmentExecute interface, which is how Chrome applies it; Firefox writes the stream directly.
| ZoneId | Zone | Typical meaning for a file | Effect on Office macros |
|---|---|---|---|
| 0 | My Computer | Created locally | Not treated as internet content |
| 1 | Local intranet | From a share or site mapped to the intranet zone | Not blocked as internet content |
| 2 | Trusted sites | From a site added to Trusted sites | Not blocked as internet content |
| 3 | Internet | Downloaded from the web or saved from an email attachment | Macros blocked by default |
| 4 | Restricted sites | From a site in Restricted sites | Treated as untrusted |
Microsoft documents three limits that matter for defenders. MOTW exists only on NTFS, so copying a file to FAT32 or similar volumes drops it. Files synced by the OneDrive sync client, or opened from SharePoint with Open in Desktop App, are not tagged. And a user can remove the tag with the Unblock check box in file Properties or with Unblock-File, unless policy hides that option.
Analysts can inspect the stream read-only, for example by viewing filename:Zone.Identifier in a text viewer, or with Get-Content -Path file -Stream Zone.Identifier in PowerShell.
Controls that rely on MOTW (SmartScreen, Office macros, Protected View)
| Control | What it does with MOTW | What happens without the tag |
|---|---|---|
| Microsoft Defender SmartScreen | Runs a reputation check when a tagged file is launched through the Windows shell | No reputation prompt at launch |
| Office Protected View | Opens files downloaded from the internet in a read-only sandboxed view | File opens in normal editing mode |
| Office internet macro blocking | Blocks VBA macros in files with ZoneId 3 and shows the Security Risk banner | Older Enable Content prompt, or macros run if policy allows |
| Smart App Control | Blocks launching some risky file types, including .iso, .vhd and .vhdx, when they carry MOTW | Those checks do not apply |
| Office add-ins | Excel and PowerPoint add-ins from the internet load disabled | Add-in loads normally |
The Office macro decision follows a fixed order documented by Microsoft: Trusted Location first, then a digital signature from a trusted publisher, then policy, then a previous Enable Content decision (Trusted Document), and only then the default internet block. Any of the earlier steps overrides MOTW, which is why exception design matters. See the Office Macro Blocking Guide for the rollout of macro policy, and Smart App Control and SmartScreen for those features.
The internet macro block applies to Access, Excel, PowerPoint, Project, Publisher, Visio and Word on Windows. It reached Current Channel in version 2206 on 27 July 2022 for the main apps, with Publisher and Project following in 2023 and 2024.
Propagation through archives and containers
MOTW protects the files inside a download only if the tool that opens the container copies the tag to each extracted or mounted file. Behaviour varies by tool and version:
| Container or path | Propagation behaviour | Defensive position |
|---|---|---|
| ZIP extracted with Windows Explorer | Explorer propagates MOTW to extracted files | Prefer the built-in extractor for internet archives |
| Third-party archive tools | Varies by product and version; for example 7-Zip made propagation an option from version 22.0 | Standardise tools and configure propagation on where offered |
| ISO, IMG, VHD, VHDX disk images | The image file is tagged; files inside have historically lost the tag when mounted, because many formats do not carry NTFS streams | Block at gateways, remove auto-mount, keep Windows patched |
| Other archive formats (for example ARJ, GZIP) | Listed by ATT&CK among formats used to carry payloads past MOTW checks | Block uncommon archive types at email and web gateways |
| Copy to FAT32, exFAT or optical media | No alternate data streams, so the tag is lost | Treat removable media as untrusted; use the USB ASR rule |
| OneDrive sync and some remote copy tools | Files arrive without MOTW | Restrict who can write to synced libraries |
Microsoft has closed several container and propagation gaps through Windows security updates, and archive tool vendors have changed defaults over time. Treat propagation as a moving target: keep Windows and archive tools current, and do not rely on MOTW as the only control for any file type.
Known bypass classes at a high level
These classes are described so defenders can map controls to them. They are not instructions. ATT&CK groups them under T1553.005 Mark-of-the-Web Bypass, part of T1553 Subvert Trust Controls.
- Container stripping: payloads inside disk images or archives lose the tag on mounting or extraction.
- File system stripping: moving files to a volume without alternate data streams removes the tag.
- Trust shortcuts: abusing Trusted Locations, Trusted sites mappings (for example an entire SharePoint tenant) or broadly trusted publisher certificates, so the MOTW check is never reached.
- Handling flaws: malformed signatures or file structures that cause a dependent control to skip its check even though the tag is present. These are fixed by vendor updates.
- Social engineering the user: persuading the user to click Unblock, or to copy a file to a synced or local folder before opening it.
- Delivery without a download: techniques such as HTML smuggling assemble the file in the browser, which then saves it; the browser normally still applies MOTW. See the HTML Smuggling Guide.
Enforcement with policy and ASR
Attachment Manager policies
| Policy (User Configuration, Windows Components, Attachment Manager) | Registry value | Recommended state | Why |
|---|---|---|---|
| Do not preserve zone information in file attachments | SaveZoneInformation | Disabled | Disabled or not configured means Windows marks attachments with zone information |
| Hide mechanisms to remove zone information | HideZoneInfoOnProperties | Enabled | Hides the Unblock button and check box from users |
| Notify antivirus programs when opening attachments | ScanWithAntiVirus | Enabled | The registered antivirus scans attachments when opened and blocks them if the scan fails |
All three sit under Software\Microsoft\Windows\CurrentVersion\Policies\Attachments and are available through the AttachmentManager Policy CSP for Intune.
Office and zone settings
- Macro policy: set "Block macros from running in Office files from the Internet" to Enabled for each app. Microsoft includes it in the Microsoft 365 Apps security baseline. These policies require Microsoft 365 Apps for enterprise.
- Trusted Locations: keep them few, local and write-protected. Files there skip the MOTW check.
- Trusted sites: do not add whole SharePoint or OneDrive tenants to Trusted sites unless write access is tightly controlled, because Microsoft notes this bypasses the macro block for anything uploaded there.
- Signed macros: trusted publisher certificates apply Windows-wide; deploy only certificates you control.
Container controls
- Gateways: block or quarantine .iso, .img, .vhd and .vhdx attachments and downloads where there is no business need, as ATT&CK mitigation M1038 Execution Prevention suggests. See the Email Security Guide.
- Auto-mount: ATT&CK mitigation M1042 Disable or Remove Feature or Program suggests changing Explorer file associations so these images do not mount on double-click. This does not remove the mount capability itself.
Attack surface reduction rules
| ASR rule | GUID | Relevance |
|---|---|---|
| Block executable files from running unless they meet a prevalence, age, or trusted list criterion | 01443614-cd74-433a-b99e-2ecdc07bfc25 | Stops rare executables even when MOTW was lost; needs cloud-delivered protection |
| Block executable content from email client and webmail | be9ba2d9-53ea-4cdc-84e5-9b1eeee46550 | Blocks executables, scripts and archives dropped by mail clients |
| Block JavaScript or VBScript from launching downloaded executable content | d3e037e1-3eb8-44c8-a917-57927947596d | Breaks script-based second stages |
| Block all Office applications from creating child processes | d4f940ab-401b-4efc-aadc-ad5f3c50688a | Limits damage if a macro runs |
| Block untrusted and unsigned processes that run from USB | b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4 | Covers the removable media path where MOTW is absent |
For deployment in audit then block mode, see How to Deploy Attack Surface Reduction Rules. Application control adds a layer that does not depend on MOTW at all: see App Control for Business (WDAC).
Rollout and rollback
- Baseline: report current Attachment Manager, Office macro and ASR settings across the estate.
- Audit: put the ASR rules in audit mode and gateway container blocking in quarantine-and-notify for two to four weeks; review what would have been blocked.
- Pilot: enforce Attachment Manager and Office policies on an IT pilot ring; confirm line-of-business templates and add-ins still load from approved Trusted Locations.
- Enforce: move ASR rules to block by ring, and block container types at gateways with an exception request process.
- Roll back narrowly: if a business process breaks, add a scoped exclusion or a specific Trusted Location for that team, never a tenant-wide Trusted sites entry or a global policy reversal.
Small and large organisations: a small organisation on Microsoft 365 Apps for business cannot use the Office macro policies, so it relies on the default internet block, gateway filtering and ASR rules through Intune. A large estate should manage all three layers by policy and measure them.
Detection and hunting
- Executions from mounted images: processes whose image path is on a newly mounted virtual drive, shortly after an .iso, .img or .vhd(x) file was downloaded or opened from email. ATT&CK detection strategy DET0257 describes this correlation.
- Executions from archive extraction folders: scripts and executables launched from temporary extraction paths or user Downloads subfolders without a Zone.Identifier stream.
- Stream creation telemetry: Sysmon Event ID 15 (FileCreateStreamHash) records alternate data stream creation, including Zone.Identifier, and can capture its contents. Missing streams on files that arrived through a browser are worth investigating. See the Sysmon Guide.
- Unblock activity: use of
Unblock-Fileor removal of Zone.Identifier streams by scripts on user endpoints. - ASR telemetry: in Defender for Endpoint advanced hunting, the
DeviceEventstable records ActionType values such asAsrUntrustedExecutableBlocked,AsrExecutableEmailContentBlockedand the matching...Auditedvalues. See the Defender for Endpoint Advanced Hunting Tables Guide. - Policy drift: alert when SaveZoneInformation is set to 1, when HideZoneInfoOnProperties is removed, or when new Trusted Locations or Trusted sites entries appear.
Metrics
- Percentage of endpoints with all three Attachment Manager policies at the recommended state.
- Percentage of Office users covered by the internet macro block policy set to Enabled.
- ASR rules in block mode as a share of planned rules, and audit hits per 1,000 devices before enforcement.
- Container attachments and downloads blocked at gateways per month, and exception requests approved.
- Number of Trusted Locations and Trusted sites entries, trending down.
Framework mapping
| Framework | Reference | Application |
|---|---|---|
| MITRE ATT&CK | T1553.005 Mark-of-the-Web Bypass; T1566.001 Spearphishing Attachment; T1204.002 Malicious File | Threat model for container and attachment delivery |
| MITRE ATT&CK mitigations | M1038 Execution Prevention; M1042 Disable or Remove Feature or Program | Gateway blocking and auto-mount removal |
| NIST SP 800-53 Rev 5 | SI-3 Malicious Code Protection; CM-7 Least Functionality; SI-4 System Monitoring | ASR, container restrictions, hunting |
| NIST CSF 2.0 | PR.PS-05 unauthorised software execution prevented; DE.CM-09 computing and software monitored | Enforcement and detection |
Common failure patterns
- Whole tenant in Trusted sites: adding SharePoint or OneDrive domains to Trusted sites to stop user complaints, which removes the macro block for anything anyone uploads.
- Unblock left visible: users are trained by habit to click Unblock or Enable Content.
- Container types allowed through mail: ISO and VHD attachments with no business need still delivered to inboxes.
- Archive tool sprawl: users installing extractors that do not propagate MOTW, or with propagation turned off.
- MOTW treated as the only layer: no ASR, application control or EDR coverage for files that arrive untagged by USB, sync or file share.
- Patch lag: MOTW handling fixes arrive in Windows security updates, so delayed patching leaves known gaps open.
Practitioner checklist
- Set Do not preserve zone information to Disabled, Hide mechanisms to remove zone information to Enabled, and Notify antivirus programs to Enabled.
- Enable "Block macros from running in Office files from the Internet" for every Office app in use.
- Review and minimise Trusted Locations, Trusted sites entries and trusted publisher certificates.
- Block .iso, .img, .vhd and .vhdx at email and web gateways unless there is a documented need.
- Remove double-click auto-mount for disk images and standardise on archive tools that propagate MOTW.
- Deploy the ASR rules above in audit, then block, by ring.
- Collect Sysmon Event ID 15 and ASR events, and hunt for untagged executions from mounted images and extraction folders.
- Keep Windows, Office and archive tools on current security updates.
Standards and references
- Microsoft Learn: Macros from the internet are blocked by default in Office
- Microsoft Learn: Policy CSP AttachmentManager
- Microsoft Learn: Attack surface reduction rules reference
- Microsoft Support: What is Protected View?
- MITRE ATT&CK: T1553.005 Mark-of-the-Web Bypass
- Eric Lawrence: Downloads and the Mark of the Web
Related NHI Mgmt Group resources: Office Macro Blocking Guide · Smart App Control and SmartScreen · How to Deploy Attack Surface Reduction Rules · HTML Smuggling Guide · Malicious LNK Files Guide