CVE-2024-20697: Windows Libarchive Remote Code Execution Vulnerability
An integer overflow in the Libarchive library included in Microsoft Windows allows a crafted RAR archive to cause out-of-bounds memory access when extracted. A remote attacker could entice a user to extract such an archive, potentially leading to arbitrary code execution in the context of the application using the library.
zerodayinitiative.com
Published on zerodayinitiative.com
An integer overflow vulnerability exists in the Libarchive library included in Microsoft Windows. The vulnerability is due to insufficient bounds checks on the block length of a RARVM filter used for Intel E8 preprocessing, included in the compressed data of a RAR archive.
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
Likely an integer overflow in the loop condition of execute_filter_e8() when the block length is 4, causing the loop counter to underflow to 0xFFFFFFFF and leading to out-of-bounds memory accesses.
Impact
Successful exploitation could result in arbitrary code execution in the context of the application using the vulnerable library.
What the attacker needed
Victim extracts a crafted RAR archive; application uses vulnerable Libarchive
The fix
Microsoft patched this vulnerability in January 2024; users should apply the vendor patch.
How it was found
- Craft a RAR archive containing a RARVM filter with the fingerprint 0x35AD576887 or 0x393CD7E57E.
- Set the 5th register of the filter to a block length of 4.
- Entice a target user to extract the crafted RAR archive using a vulnerable application.
- The extraction triggers the integer overflow and out-of-bounds memory access, potentially leading to code execution.
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.
When you open a RAR file, a library unpacks it. This library has a bug: if the file contains a special filter with a block length of 4, a calculation goes wrong and the program reads memory outside the intended buffer. An attacker could use this to run their own code on your computer if you extract a malicious RAR file.
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.