OpenImageIO PSD format image file directory denial of service vulnerability
A heap out-of-bounds read exists in OpenImageIO when parsing the image file directory of a PSD file, because the TIFF directory offset is used without bounds checking. An attacker can supply a crafted .psd file to cause a read of an arbitrary memory address, leading to a crash and denial of service.
Originally disclosed on Cisco Talos
A heap out of bounds read vulnerability exists in the OpenImageIO master-branch-9aeece7a when parsing the image file directory part of a PSD image file. A specially-crafted .psd file can cause a read of arbitrary memory address which can lead to denial of service.
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 TIFF directory offset from the Exif header is used to compute a pointer without verifying it lies within the Exif data buffer, so the subsequent read of the directory entry count can access out-of-bounds memory.
Impact
The out-of-bounds read can cause a crash, resulting in denial of service; further impact is limited because bounds checking inside read_exif_tag prevents more than an unmapped memory read.
What the attacker needed
Victim opens a crafted .psd file
The fix
The vulnerability was fixed by the vendor in a patch release.
How it was found
- Craft a .psd file with an image resource block whose id is 1058, containing Exif data.
- Set the TIFF header's directory offset to an arbitrary value.
- Open the file with OpenImageIO, which reads the resource and calls decode_exif.
- decode_ifd reads the directory entry count from the unchecked offset, causing an out-of-bounds read and 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 report has not been written yet. The Original tab links to the source.
OpenImageIO is a library that reads many image formats, including Photoshop's .psd files. When it reads a .psd file, it also parses embedded Exif metadata, which contains a pointer to a directory of tags. The code trusts that pointer without checking it stays inside the file, so a malicious file can make the program read from an invalid memory address and crash.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.