Libarchive mtree parse_device Code Execution Vulnerability
A stack-based buffer overflow exists in libarchive's mtree parse_device function because the bounds check occurs after writing to the array, allowing one extra element to be written. An attacker could send a malformed mtree file to cause memory corruption and potentially code execution.
Originally disclosed on Cisco Talos
An exploitable stack based buffer overflow vulnerability exists in the mtree parsedevice functionality of libarchive. A specially crafted mtree file can cause a buffer overflow resulting in memory corruption/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 bounds check is performed after writing to the array, so the array can be overflowed by one element.
Impact
An attacker could cause memory corruption and potentially execute code, though the CVSS vector indicates local access and user interaction are required.
What the attacker needed
Victim opens a crafted mtree 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 buffer overflow happens when a program writes more data into a fixed-size memory area than it can hold, overwriting nearby data. Here, a file parser for the mtree format has a small array meant for three numbers, but a mistake lets it write a fourth number, corrupting memory. This could 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.