OpenImageIO TIFF file IPTC data information disclosure vulnerability
A heap out-of-bounds read occurs when parsing IPTC data in TIFF images because the code treats a byte count as a count of 32-bit integers, causing it to read four times too much data. An attacker can supply a crafted TIFF file to leak adjacent heap memory, potentially exposing sensitive process information.
Originally disclosed on Cisco Talos
A heap out of bounds read vulnerability exists in the handling of IPTC data while parsing TIFF images in OpenImageIO v2.3.19.0. A specially-crafted TIFF file can cause a read of adjacent heap memory, which can leak sensitive process information.
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 code casts a byte pointer to a uint32_t pointer and uses the byte count as the number of elements, so the vector constructor reads four times the intended size.
Impact
The out-of-bounds read could leak sensitive process information, and combined with another vulnerability it could be used as an information leak component to bypass mitigations.
What the attacker needed
Victim opens a crafted TIFF file
The fix
The vulnerability was fixed in the current master branch (commit 9aeec7a).
How it was found
- Craft a TIFF file with a TIFFTAG_RICHTIFFIPTC directory entry whose tdir_count is small (e.g., 0xa) and whose data is at a chosen offset.
- Open the crafted TIFF file with OpenImageIO, which triggers TIFFInput::readspec and the vulnerable vector construction.
- Observe the out-of-bounds read of heap memory beyond the IPTC data buffer.
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.
When a program reads a file, it must not read past the end of the data it was given. Here, the program mistakenly multiplied the size by four, so it read extra memory beyond the intended buffer. That extra memory could contain private data from the program, which an attacker might see if the image is later saved or displayed.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.