Android libstagefright still exploitable
The patch for CVE-2015-3824 in Android's Stagefright media parser was incomplete because it compared a 64-bit chunk size against a 32-bit maximum, allowing a crafted MP4 to bypass the check and cause a heap overflow. An attacker could exploit this to crash or potentially execute code on a patched device.
blog.exodusintel.com
Published on blog.exodusintel.com
AUGUST 13, 2015 Vulnerability Analysis, Exploit Techniques
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 patch compared a 64-bit chunk_size variable against SIZE_MAX (a 32-bit value), so a chunk_size larger than 32 bits bypassed the overflow check, and the subsequent addition and allocation still overflowed.
Impact
An attacker could cause a heap overflow, leading to a crash and potentially code execution, on devices that have the faulty patch installed.
What the attacker needed
Victim opens a crafted MP4 file; device runs Android with the faulty patch
The fix
The text does not state a corrected fix; it only notes that Google allocated CVE-2015-3864 and had not provided a timeline for a proper patch.
How it was found
- Craft an MP4 file with a chunk_size value larger than 32 bits (e.g., 0x1ffffffff) to bypass the patch's overflow check.
- Set the size variable to a value greater than 0 so that adding chunk_size causes an integer overflow.
- The overflowed sum is truncated when passed to the new operator, allocating an undersized buffer.
- The parser then reads chunk_size bytes into the undersized buffer, causing a heap overflow.
- Test the crafted MP4 on a Nexus 5 device with the supposedly patched firmware to observe a crash.
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.
Android phones use a media library called Stagefright to process video files. A security fix was released for a bug in how it handled certain MP4 files, but the fix had a mistake: it checked a large number against a smaller limit, so a specially made file could still slip through. This means even phones with the update could be crashed or taken over by a malicious video.
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.