Exploring ZIP Mark-of-the-Web Bypass Vulnerability (CVE-2022-41049)
A flaw in Windows Explorer's ZIP extraction allowed a crafted ZIP file to bypass the Mark-of-the-Web (MOTW) security warning. An attacker could deliver a malicious file inside such a ZIP, and when extracted, it would lack the MOTW, so Windows would not warn the user before execution.
Published on breakdev.org
In October 2022, I've come across a tweet from 5th July, from @wdormann, who reported a discovery of a new method for bypassing MOTW, using a flaw in how Windows handles file extraction from ZIP files.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The ZIP file's external attributes marked the extracted file as read-only, causing Windows to fail when writing the MOTW alternate data stream.
Impact
An attacker could deliver a malicious file inside a ZIP that, when extracted, lacks the MOTW warning, so the user might execute it without the usual security prompt.
What the attacker needed
Windows system; User extracts ZIP with Explorer; User executes extracted file
The fix
Microsoft fixed the vulnerability, though the exact patch details are not analysed in the text.
How it was found
- Create a ZIP file containing a JScript file and add a MOTW alternate data stream to the ZIP.
- Modify the ZIP's external attributes to set the read-only bit.
- Extract the file from the ZIP using Windows Explorer.
- Execute the extracted file; no MOTW warning appears.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Mark-of-the-Web (MOTW) is a tag Windows adds to files downloaded from the internet, so it can warn you before opening them. This report shows that by setting a special attribute inside a ZIP file, an attacker could make Windows skip adding that tag when extracting the file, so the warning never appeared.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.