Skip to content
Info disclosure Advisory Advanced CVE-2021-30939

Apple macOS ImageIO DDS image out-of-bounds read vulnerability

An out-of-bounds read vulnerability exists in the DDS image parsing functionality of ImageIO on Apple macOS and iOS. A specially-crafted DDS file can disclose sensitive memory content which can aid in exploitation of other vulnerabilities.

Jaewon Min Follow

Originally disclosed on Cisco Talos

Medium 5.3 View original

An out-of-bounds read vulnerability exists in the DDS image parsing functionality of ImageIO library on Apple macOS Big Sur 11.6.1 and iOS 15.1. A specially-crafted DDS file can disclose sensitive memory content which can aid in exploitation of other vulnerabilities.

Jaewon Min, 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 the size checks for width and height compare against the entire file size instead of the size of the image data after the header, so the decoder can read beyond the file buffer.

Impact

The out-of-bounds read could disclose sensitive memory content, such as heap addresses, which could aid in exploitation of other vulnerabilities; the text notes that without GuardMalloc, arbitrary data will be decoded and presented as pixels unless the access hits invalid memory.

What the attacker needed

Victim opens a crafted DDS file; no user interaction beyond opening the file

The fix

The vendor patched the vulnerability, likely by correcting the size checks to compare against the actual image data size rather than the entire file size.

How it was found

  1. Craft a DDS file with a valid header and set width and height fields to non-zero values.
  2. Set the flags field to satisfy the required bit checks.
  3. Set the four-character code to DXT1 (or DXT3/DXT5) to invoke the DXT decoder.
  4. Ensure the file size is exactly 0x80 bytes (header only, no data section).
  5. Open the file with an application that uses ImageIO to parse it, causing an out-of-bounds read.

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.

ImageIO is a system component that reads image files. When it reads a DDS image, it checks the image's width and height against the whole file size, but the actual image data starts after a fixed header. This means a crafted file can make the decoder read past the end of the file data, into other memory, and show that memory as pixels.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Jaewon Min

View all

7 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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.