# Mark of the Web

The Mark of the Web (MoTW) is a metadata identifier used by Microsoft Windows to mark files downloaded from the Internet as potentially unsafe. Although termed the "Mark of the Web", it is sometimes also found on files from other sources perceived to be of high risk, including files copied from NTFS-formatted external drives and themselves downloaded from the web at some earlier point.
It is implemented using the alternate data stream (ADS) feature of Microsoft's default NTFS filesystem. Due to its reliance on features exclusive to NTFS, transferring the file to or from a partition with an alternative filesystem, such as FAT32 or Ext3, will strip the file of its ADSs and thus the mark. These alternate streams are intended to be transparent (i.e. hidden from most users) and are not shown to or made editable by users through any GUI built into Windows by default.
A second type of MotW can arise when saving a webpage as an HTML document, as most browsers will insert an HTML comment in the process while noting the URL from which the document was saved. This form of mark is significantly different in that it is clearly accessible to users and is embedded within the file itself, rather than the ADS metadata, making it easy to manually spot and remove.
The mark was added by all versions of Internet Explorer supported by Windows 7 and later. Without deep modifications to the source code, all Chromium (e.g. Google Chrome) and Firefox-based web browsers also write the mark's stream to downloaded files. All of these browsers additionally add the second type of mark in the form of the source URL of downloaded webpages as a HTML comment at the beginning of the file. Chromium and Firefox-based browser marks contain the domain name and exact URL of the original online download location, potentially offering a deeply esoteric method of tracking browsing history with concomitant privacy risks.

## Effects

Windows warns users attempting to open a Web-marked file that it was downloaded from the Internet and could be harmful; the user can opt either to continue or cancel execution. If the file is executable and the user opts to override the warning, the mark will be removed from the file in order to prevent the same prompting each time. Unless overridden by user action, the mark prevents macros from running in Microsoft Office files. Visual Studio projects created with Web-marked files cannot be built or executed.
Some archiving software propagates the MoTW from the archive itself to files extracted from it, preventing its security protection being bypassed by malware distributed within an archive.
If the downloaded file is an executable (e.g. an installer), the mark stream can be used for reflection, enabling the program to identify from where it was downloaded, which is occasionally used for telemetry and/or security purposes. A program can attempt to verify that it was downloaded from an official source (assuming the stream has not been removed or spoofed) and can transmit this information back over the internet (an example of this in action is BiglyBT's installer).

## Implementation

ADS is a form of fork allowing more than one data stream to be associated with a filename/file using the format filename:streamname (e.g. notepad.exe:extrastream). Although intended for helpful metadata, their arcane nature makes them a possible hiding place for potentially unwanted information, including, in the case of the MoTW, the browser history associated with the downloaded file.
In the case of the mark, the ADS is named Zone.Identifier. As of Windows 10, the contents of the Zone.Identifier stream are structured like an INI file (i.e. a key-value store) that includes the keys HostIpAddress, HostUrl, and ReferrerUrl. To some extent, these are implementation-defined fields, but they typically contain the domain name and exact URL of the original online download location.

## Bypasses, security, and privacy concerns

There have been several Windows vulnerabilities that have enabled malicious actors to fully or partially bypass the mark or allowed it to be used in the proliferation of malware by e.g. hiding code. Many or all of the known exploits have been corrected by patches. Due to the privacy concerns associated with the mark and the Zone.Identifier stream, including the storage of the exact domain name and origin URL of the file, there exists software specifically designed to strip the information from files in a user-friendly way.
An exploit with the Common Vulnerabilities and Exposures (CVE) identifier CVE-2022-41091 was added to the National Vulnerability Database on November 8, 2022, and refers to the now-patched ability of a malicious actor to avoid files downloaded from the Internet being marked. Other vulnerabilities (CVE-2022-44698, patched in December 2022 and CVE-2023-36584, patched in October 2023) allowed malicious actors to bypass the restrictions of the mark without removing it. In September 2024, another exploit (CVE-2024-38217) was found that, under some circumstances, allowed the full removal, and thus bypass of all detection, of the mark, and was additionally found to be in active use in the wild. It has also since been patched.
An attacker may also use social engineering to convince a target user to unblock the file by right-clicking it and changing the file properties.