Home

Awesome

Comparison of MOTW (Mark of the Web) propagation support of archiver software for Windows

English | Japanese

Background

On 3 March 2022, Microsoft announced that the default behavior of Office applications on Windows will be changed to block macros in files from the internet (such as email attachment).

An excerpt from the announcement:

VBA macros are a common way for malicious actors to gain access to deploy malware and ransomware. Therefore, to help improve security in Office, we’re changing the default behavior of Office applications to block macros in files from the internet.

...

This change only affects Office on devices running Windows and only affects the following applications: Access, Excel, PowerPoint, Visio, and Word.

The change will begin rolling out in Version 2203, starting with Current Channel (Preview) in early April 2022. Later, the change will be available in the other update channels, such as Current Channel and Monthly Enterprise Channel.

This is a great improvement of defense against malicious Office document files.

According to the announcement, whether blocking macro or not is determined based on MOTW (Mark of the Web) attribute of the file. Applications such as web browsers and email clients put MOTW on downloaded files and email attachments that come from the internet. MOTW is stored in Zone.Identifier NTFS alternate data stream.

To block macro of malicious Office document files that are extracted from archive files, an archiver software has to propagate MOTW to extracted files when an archive file has MOTW. If archiver software does not propagate MOTW, malicious Office documents in archive files can circumvent blocking.

A question came up: "What archiver software can propagate MOTW to extracted files?" So I tested some archiver software and summarized the result.

Comparison table of MOTW propagation support (as of 12 August 2024)

NameTested versionLicenseMOTW propagationEnabled by defaultNote
"Extract all" built-in function of Windows ExplorerWindows 11 23H2<br>Windows 10 22H2proprietaryYes :heavy_check_mark:Yes :heavy_check_mark:MOTW bypass vulnerabilities (fixed) <a href="#*1">*1</a>
7-Zip24.08GNU LGPLYes :heavy_check_mark:No :x: <a href="#*2">*2</a>
BandizipStandard Edition 7.36freewareYes :heavy_check_mark:Yes :heavy_check_mark:MOTW bypass vulnerability (fixed) <a href="#*3">*3</a><br>Only for specific file extensions <a href="#*4">*4</a>
CubeICE3.4.0freeware / proprietaryYes :heavy_check_mark:Yes :heavy_check_mark:MOTW bypass vulnerability (fixed) <a href="#*5">*5</a>
Explzh9.48proprietary for commercial useYes :heavy_check_mark:Yes :heavy_check_mark:
NanaZip3.0.1000.0MITYes :heavy_check_mark:No :x: <a href="#*6">*6</a>
PeaZip9.9.0GNU LGPLYes :heavy_check_mark:Yes :heavy_check_mark:
TC4Shell21.3.0 (trial)proprietaryYes :heavy_check_mark:Yes :heavy_check_mark:
Total Commander11.03 (trial)proprietaryYes :heavy_check_mark:Yes :heavy_check_mark:
WinRAR7.01 (trial)proprietaryYes :heavy_check_mark:Yes :heavy_check_mark:Only for specific file extensions by default <a href="#*7">*7</a>
WinZip76.8 (trial)proprietaryYes :heavy_check_mark:Yes :heavy_check_mark:
Ashampoo ZIP Free1.0.7freeware (registration required)No :x:
CAM UnZip5.22.6.0proprietary for commercial useNo :x:
Expand-Archive cmdlet of PowerShell7.4.4MITNo :x:
Express Zip11.13proprietary for commercial useNo :x:
File Compact7.02proprietaryNo :x:
IZArc4.5freewareNo :x:
LhaForge1.6.7MITNo :x:
Lhaplus1.74freewareNo :x:
PowerArchiver22.00.09 (trial)proprietaryNo :x:
StuffIt Expander15.0.8freewareNo :x:
tar.exe (bsdtar) of Windows 113.6.2BSD 2-clauseNo :x:
Universal Extractor 22.0.0 RC 3GNU GPLv2No :x:
ZipGenious6.3.2.3116freewareNo :x:
Zipware1.6freewareNo :x:

<a id="*1">*1</a>: There were two MOTW bypass vulnerabilities of Windows and they were fixed by the security updates released on 8 November 2022.

<a id="*2">*2</a>: Though 7-Zip has supported MOTW propagation since version 22.00, it is disabled by default. You can enable it for 7-Zip GUI with the "Propagate Zone Id stream:" option in "Tools" -> "Options" -> "7-Zip" of 7-Zip File Manager.

images/7-zip-setting.png

When you set the option to Yes, 7-Zip propagates MOTW to all extracted files. When you set it to "For Office files", 7-Zip propagates MOTW to files with the following file extensions:

You can also enable MOTW propagation by setting the registry HKEY_CURRENT_USER\SOFTWARE\7-Zip\Options\WriteZoneIdExtract DWORD to 1.

For 7-Zip CLI, -snz switch is required to propagate MOTW regardless of the option above.

<a id="*3">*3</a>: There was a MOTW bypass vulnerability of Bandizip and it was fixed in Bandizip 7.29 released on 21 November 2022 (release note). The vulnerability is almost the same as CVE-2022-41049 of Windows (<a href="#*1">*1</a>) and it can be exploited by just setting read-only file attribute to ZIP file contents. I found the vulnerability and reported it to Bandisoft, the developer of Bandizip. Bandisoft fixed it very quickly.

<a id="*4">*4</a>: Accoring to the document of Bandizip, Bandizip propagates MOTW to files with the following file extensions:

I previously tested Bandizip with a ZIP archive file that contained only text files, and I misunderstood that Bandizip does not propagate MOTW.

<a id="*5">*5</a>: CubeICE has supported MOTW propagation since version 3.0.0, but this version had a MOTW bypass vulnerability. The vulnerability was fixed in version 3.0.1 released on 5 April 2023 (release note). The vulnerability is almost the same as CVE-2022-41049 of Windows (<a href="#*1">*1</a>) and it can be exploited by just setting read-only file attribute to ZIP file contents. I found the vulnerability and reported it to CubeSoft, the developer of CubeICE. CubeICE fixed it very quickly.

<a id="*6">*6</a>: Though NanaZip has supported MOTW propagation since version 2.0 Preview 1, it is disabled by default. You can enable it with the "Propagate Zone Id stream:" option in "Tools" -> "Options" -> "Integration" of NanaZip GUI.

When you set the option to Yes, NanaZip propagate MOTW to all extracted files. When you set it to "For Office files", NanaZip propagate MOTW to files with the following file extensions:

<a id="*7">*7</a>: WinRAR 7.0 introduced the "Propagate Mark of the Web" option. You can choose the following values:

The option is supported only by WinRAR GUI. WinRAR CLI does not propagate MOTW regardless of the option.

images/winrar-setting.png

The default is "For executable and office files" and WinRAR propagates MOTW to files with the following file extensions:

When you set the option to "For office files", WinRAR propagates MOTW to files with the following file extensions:

You can specify file extensions when you set the option to "For user defined types".

Comparison table of MOTW propagation behavior (as of 12 August 2024)

NameTested versionMOTW propagation behavior
"Extract all" built-in function of Windows ExplorerWindows 11 23H2<br>Windows 10 22H2<ul><li>MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet) or 4 (Untrusted sites)</li><li>ZoneId field of the archive file is inherited</li><li>The absolute path of the archive file is set for the ReferrerUrl field</li><li>All other fields are ignored</li></ul>
7-Zip24.08<ul><li>MOTW of the archive file is propagated without modification</li><li>Only for specific file extensions if the "Propagate Zone Id stream:" option is set to "For Office files" <a href="#*2">*2</a></li></ul>
BandizipStandard Edition 7.36<ul><li>MOTW of the archive file is propagated without modification</li><li>Only for specific file extensions <a href="#*4">*4</a></li></ul>
CubeICE3.4.0<ul><li>MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet) or 4 (Untrusted sites)</li><li>Only ZoneId field of the archive file is inherited and all other fields are ignored</li></ul>
Explzh9.48<ul><li>MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet)</li><li>Only ZoneId field of the archive file is inherited and all other fields are ignored</li></ul>
NanaZip3.0.1000.0<ul><li>MOTW of the archive file is propagated without modification</li><li>Only for specific file extensions if the "Propagate Zone Id stream:" option is set to "For Office files" <a href="#*6">*6</a></li></ul>
PeaZip9.9.0<ul><li>MOTW of the archive file is propagated without modification</li></ul>
TC4Shell21.3.0 (trial)<ul><li>Only ZoneId field of the archive file is inherited and all other fields are ignored</li></ul>
Total Commander11.03 (trial)<ul><li>MOTW of the archive file is propagated except for the ReferrerUrl field</li></ul>
WinRAR7.01 (trial)<ul><li>Only ZoneId field of the archive file is inherited and all other fields are ignored</li><li>Only for specific file extensions <a href="#*7">*7</a></li></ul>
WinZip76.8 (trial)<ul><li>MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet)</li><li>ZoneId field of the archive file is inherited</li><li>The absolute path of the archive file is set for the ReferrerUrl field</li><li>All other fields are ignored</li></ul>

MOTW propagation examples

In these examples, MOTW was manually set for a ZIP archive file motw-test.zip with Set-MOTW.ps1, then MOTW of an extracted file is displayed with Get-MOTW.ps1. Set-MOTW.ps1 and Get-MOTW.ps1 are available at my PS-MOTW repository.

FAQ

References

Author

Nobutaka Mantani (@nmantani)