Skip to content
Memory corruption Advisory Advanced CVE-2016-4630

Apple Image I/O EXR Compression Remote Code Execution Vulnerability

A heap-based buffer overflow exists in Apple's Image I/O handling of EXR images using B44 compression, where a user-controlled size value is truncated when stored in an int. Opening a crafted EXR file in any application using the Image I/O API could lead to an out-of-bounds write and remote code execution.

Tyler Bohan Follow

Originally disclosed on Cisco Talos

High 7.1 View original

An exploitable heap based buffer overflow exists in the handling of EXR images on OS X. A crafted EXR document can lead to a heap based buffer overflow resulting in remote code execution.

Tyler Bohan, on Cisco Talos

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

Likely a user-controlled compressed data size is stored in an int despite being a long, so the value is truncated and a later memory copy writes out of bounds.

Impact

Opening a crafted EXR file could allow an attacker to achieve remote code execution, though the CVSS score reflects only high confidentiality and low integrity impact.

What the attacker needed

Victim opens a crafted EXR file; application uses Apple Image I/O API

How it was found

  1. Open a crafted EXR file that uses B44 compression in an application using the Apple Image I/O API, such as Preview.
  2. The B44 decompressor reads a user-controlled size for the compressed data.
  3. The size is truncated when stored in an int, causing an excessively large allocation request and an out-of-bounds memory copy.
  4. The process crashes with a bad memory access, demonstrating the overflow.

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.

An EXR file is a high-dynamic-range image format. When the system reads a specially made EXR file, it trusts a size value written in the file; that number is too big for the variable it is stored in, so it gets cut down, and the program then copies data past the end of a memory buffer. Because the copied data comes from the file, an attacker could use this to run their own code on the machine.

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.

More by Tyler Bohan

View all

84 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.