Libarchive zip zip_read_mac_metadata Code Execution Vulnerability
A heap overflow in libarchive's handling of Mac metadata in zip files allows an attacker to cause memory corruption and potentially execute code by supplying a specially crafted zip file.
Originally disclosed on Cisco Talos
An exploitable heap overflow vulnerability exists in the zip archive decompression functionality of libarchive. A specially crafted zip file can cause memory corruption leading to code execution.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code allocates a buffer using an unchecked uncompressed size from the zip file, which can be zero, and then copies data based on a separate compressed size, leading to a heap overflow.
Impact
An attacker could cause memory corruption, potentially leading to code execution, though the CVSS vector indicates local access and user interaction are required.
What the attacker needed
Victim opens a crafted zip file
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 report has not been written yet. The Original tab links to the source.
A zip file can contain extra information for Mac computers, called metadata. The library that reads zip files (libarchive) had a bug: it could be tricked into writing more data than it had space for, which can crash the program or let an attacker run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.