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.[1][2] 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.[3] 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.[4] 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.[5]
Effects
[edit]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.[1] 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.[6][7] Visual Studio projects created with Web-marked files cannot be built or executed.[8]
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.[9][10]
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
[edit]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.Identifer
. As of Windows 10, the contents of the Zone.Identifer
stream are structured like an INI file (i.e. a key-value store) that includes the keys HostIpAddress
, HostUrl
, and ReferrerUrl
.[11] 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
[edit]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.[12] 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.[13]
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.[14][15] Other vulnerabilities (CVE-2022-44698, patched in December 2022[16] and CVE-2023-36584, patched in October 2023)[17] 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.[18] 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.[19]
References
[edit]- ^ a b Lawrence, Eric (2016-04-04). "Downloads and the Mark-of-the-Web". text/plain. Retrieved 2024-01-09.
- ^ Abrams, Lawrence (10 November 2022). "Microsoft fixes Windows zero-day bug exploited to push malware". BleepingComputer.
- ^ Russinovich, Mark E.; Solomon, David A.; Ionescu, Alex (2009). "File Systems". Windows Internals (5th ed.). Microsoft Press. p. 921. ISBN 978-0-7356-2530-3.
One component in Windows that uses multiple data streams is the Attachment Execution Service[...] depending on which zone the file was downloaded from [...] Windows Explorer might warn the user
- ^ kexugit (2011-03-23). "Understanding Local Machine Zone Lockdown". Microsoft Learn. Retrieved 2024-01-09.
- ^ Wilson, Craig (October 8, 2021). "Forensic Analysis of the Zone.Identifier Stream". Digital Detective.
- ^ "Macro Security for Microsoft Office". National Cyber Security Center (NCSC). 3.0. 11 October 2023 [21 February 2019].
- ^ nicholasswhite (2023-12-14). "Macros from the internet are blocked by default in Office - Deploy Office". Microsoft Learn. Retrieved 2024-01-09.
- ^ Nagel, Eric (2019-08-26). "Remove the Mark of the Web: Visual Studio 2019 Build Error". Eric Nagel. Retrieved 2024-01-09.
- ^ Wixey, Matt (12 October 2022). "Are threat actors turning to archives and disk images as macro usage dwindles?". Sophos News. Retrieved 28 February 2024.
- ^ Boyd, Christopher (21 June 2022). "7-Zip gets Mark of the Web feature, increases protection for users". Malwarebytes.
- ^ "About URL Security Zones (Windows)". learn.microsoft.com. August 15, 2017.
- ^ "Malware utilising Alternate Data Streams?". AusCERT Web Log. 21 August 2007. Archived from the original on 2011-02-23.
- ^ "fafalone/ZoneStripper". December 25, 2024 – via GitHub.
- ^ "CVE-2022-41091". NIST National Vulnerability Database. Retrieved 2024-01-09.
- ^ "Windows Mark of the Web Security Feature Bypass Vulnerability". Microsoft MSRC. 2022-11-08. Retrieved 2024-01-09.
- ^ "CVE-2022-44698". NIST National Vulnerability Database. Retrieved 2024-01-09.
- ^ "CVE-2023-36584". NIST National Vulnerability Database. 2023-10-10. Retrieved 2024-06-18.
- ^ Kolsek, Mitja. "Micropatches for "LNK Stomping" Windows Mark of the Web Security Feature Bypass (CVE-2024-38217)".
- ^ Hegt, Stan (2020-03-30). "Mark-of-the-Web from a Red Team's Perspective". Outflank. Retrieved 2024-06-19.