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.
Originally disclosed on Cisco Talos
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.
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
- Craft a DDS file with a valid header and set width and height fields to non-zero values.
- Set the flags field to satisfy the required bit checks.
- Set the four-character code to DXT1 (or DXT3/DXT5) to invoke the DXT decoder.
- Ensure the file size is exactly 0x80 bytes (header only, no data section).
- 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.