A newly discovered vulnerability, recognized as CVE-2025-0411, affects the popular file archiving and compression software, 7-Zip. This security flaw enables remote attackers to bypass the Mark-of-the-Web (MOTW) protection mechanism on affected installations. A user must interact with the vulnerability through visiting a malicious website or opening a malicious file, which makes exploitation more difficult, but not impossible.
Description
The crux of the vulnerability resides in how 7-Zip deals with archived files. When unpacking files from an archive that bears the Mark-of-the-Web, 7-Zip fails to propagate MOTW to the files being extracted. Consequently, an attacker can exploit this glitch by running arbitrary code in the context of the current user. The vulnerability was previously identified as ZDI-CAN-25456 before being assigned CVE-2025-0411.
Code Snippet
The following is a simplified example of how a crafted archive might exploit this vulnerability.
from zipfile import ZipFile
def create_malicious_zip(fname):
with ZipFile(fname, 'w') as zf:
# add a file containing malicious payload
zf.write('malicious_payload.txt')
def exploit_7zip_motw_bypass(fname):
# create a malicious ZIP archive
create_malicious_zip(fname)
# coerce target/user to extract the malicious ZIP file, potentially bypassing MOTW
if __name__ == '__main__':
exploit_7zip_motw_bypass('malicious_archive.zip')
Exploit Details
An attacker who successfully exploits this vulnerability can carry out a remote attack, gaining unauthorized access to the target's system. The attacker can then execute arbitrary code within the user's context. For example, the attacker could escalate their privileges by running malware or compromising sensitive data.
Original references
1. CVE-2025-0411: "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-0411"
2. ZDI-CAN-25456: "https://www.zerodayinitiative.com/advisories/ZDI-CAN-25456/"
Mitigation
Users should ensure they have installed the latest version of 7-Zip and apply any necessary updates or patches to mitigate this vulnerability. Additionally, exercise caution when opening files or visiting websites from untrusted sources.
Conclusion
CVE-2025-0411 is a severe vulnerability that affects installations of 7-Zip, leaving users potentially exposed to remote attacks. It underscores the importance of keeping software up-to-date and using common-sense security practices like avoiding potentially malicious websites and files. By taking these precautions, users can reduce their risk of becoming a victim of such attacks.
Timeline
Published on: 01/25/2025 05:15:09 UTC