Git Product home page Git Product logo

archiver-motw-support-comparison's Introduction

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

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 21 November 2022)

Name Tested version License MOTW propagation Note
"Extract all" built-in function of Windows Explorer Windows 10 22H2 proprietary Yes ✔️ MOTW bypass vulnerabilities (fixed) *1
7-Zip 22.01 GNU LGPL Yes ✔️ Disabled by default *2
Bandizip Standard Edition 7.29 freeware Yes ✔️ MOTW bypass vulnerability (fixed) *3
Only for specific file extensions *4
Explzh 8.81 proprietary for commercial use Yes ✔️
NanaZip 2.0.396.0 MIT Yes ✔️ Disabled by default *5
PeaZip 8.9.0 GNU LGPL Yes ✔️
WinRAR 6.11 (trial) proprietary Yes ✔️ Only for specific file extensions *6
WinZip 27.0 (trial) proprietary Yes ✔️
Ashampoo ZIP Free 1.0.7 freeware (registration required) No ❌
CAM UnZip 5.22.6.0 proprietary for commercial use No ❌
CubeICE 2.0.0 freeware No ❌
Expand-Archive cmdlet of PowerShell 7.2.7 MIT No ❌
IZArc 4.5 freeware No ❌
LhaForge 1.6.7 MIT No ❌
Lhaplus 1.74 freeware No ❌
PowerArchiver 21.00.18 (trial) proprietary No ❌
StuffIt Expander 15.0.8 freeware No ❌
tar.exe (bsdtar) of Windows 10 3.5.2 BSD 2-clause No ❌
ZipGenious 6.3.2.3116 freeware No ❌
Zipware 1.6 freeware No ❌

*1: There were two MOTW bypass vulnerabilities of Windows Explorer and they were fixed by the security updates released on 8 November 2022.

*2: 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 propagate MOTW to all extracted files. When you set it to "For Office files", 7-Zip propagate MOTW to files with the following file extensions:

  • .doc .docb .docm .docx .dot .dotm .dotx .wbk .wll .wwl
  • .pot .potm .potx .ppa .ppam .pps .ppsm .ppsx .ppt .pptm .pptx .sldm .sldx
  • .xla .xlam .xlm .xls .xlsb .xlsm .xlsx .xlt .xltm .xltx

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.

*3: 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 Explorer (*1) and it can be exploited by just setting read-only file attributes to ZIP file contents. I found the vulnerability and reported it to Bandisoft, the developer of Bandizip. Bandisoft fixed it very quickly.

*4: Accoring to the document of Bandizip, Bandizip propagates MOTW to files with the following file extensions:

  • .exe .com .msi .scr .bat .cmd .pif .bat .lnk
  • .zip .zipx .rar .7z .alz .egg .cab .bh
  • .iso .img .isz .udf .wim .bin .i00
  • .js .jse .vbs .vbe .wsf
  • .url .reg
  • .docx .doc .xls .xlsx .ppt .pptx .wiz

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

*5: 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:

  • .doc .docb .docm .docx .dot .dotm .dotx .wbk .wll .wwl
  • .pot .potm .potx .ppa .ppam .pps .ppsm .ppsx .ppt .pptm .pptx .sldm .sldx
  • .xla .xlam .xlm .xls .xlsb .xlsm .xlsx .xlt .xltm .xltx

*6: Jernej Simončič (@jernej__s) kindly contacted the developer of WinRAR and got the answer that WinRAR propagates MOTW only to Microsoft Office document files. It seems that the supported file types are not documented. I did additional tests with WinRAR 6.11 and confirmed that it propagates MOTW to document files of Word, Excel, and PowerPoint (files of Access and Publisher are not supported).

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

Comparison table of MOTW propagation behavior (as of 21 November 2022)

Name Tested version MOTW propagation behavior
"Extract all" built-in function of Windows Explorer Windows 10 21H2
  • MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet) or 4 (Untrusted sites)
  • ZoneId field of the archive file is inherited
  • The absolute path of the archive file is set for the ReferrerUrl field
  • All other fields are ignored
7-Zip 22.01
  • MOTW of the archive file is propagated without modification
  • Only for specific file extensions if the "Propagate Zone Id stream:" option is set to "For Office files" *2
Bandizip Standard Edition 7.29
  • MOTW of the archive file is propagated without modification
  • Only for specific file extensions *4
Explzh 8.81
  • MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet)
  • Only ZoneId field of the archive file is inherited and all other fields are ignored
NanaZip 2.0.396.0
  • MOTW of the archive file is propagated without modification
  • Only for specific file extensions if the "Propagate Zone Id stream:" option is set to "For Office files" *5
PeaZip 8.9.0
  • MOTW of the archive file is propagated without modification
WinRAR 6.11 (trial)
  • MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet)
  • Only ZoneId field of the archive file is inherited and all other fields are ignored
  • Only for specific file extensions *6
WinZip 27.0 (trial)
  • MOTW is propagated only if ZoneId value of the MOTW is 3 (Internet) or 4 (Untrusted sites)
  • ZoneId field of the archive file is inherited
  • The absolute path of the archive file is set for the ReferrerUrl field
  • All other fields are ignored

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.

  • MOTW of a file extracted with Windows Explorer or WinZip: images/explorer.png

  • MOTW of a file extracted with 7-Zip, Bandizip, NanaZip, or PeaZip: images/bandizip.png

  • MOTW of a file extracted with Explzh or WinRAR: images/explzh.png

FAQ

References

Author

Nobutaka Mantani (@nmantani)

archiver-motw-support-comparison's People

Contributors

nmantani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.