Executive brief
libheif is a software library used by many applications to process HEIF and AVIF image files. A vulnerability in how it handles uncompressed images allows a specially crafted file to cause the application to crash. This could lead to a denial-of-service, preventing users from viewing images or causing software that processes these files to fail.
Technical details
An out-of-bounds read vulnerability exists in libheif's uncompressed HEIF decoder (unc_decoder.cc) due to an integer overflow in a range check. The function unc_decoder::get_compressed_image_data_uncompressed validates 'icef' compressed-unit offsets using the addition 'unit_offset + unit_size'. An attacker can provide a crafted HEIF file with values that wrap around, bypassing the check and allowing the construction of iterators outside the compressed item buffer. This results in a heap-based out-of-bounds read and a process crash. The vulnerability is reachable when the 'cmpC' compressed unit type is not 'image_tile' and requires the user to open a malicious file. The issue is fixed in version 1.22.1 by implementing proper subtraction-based bounds checking.
Affected products
- strukturag libheif < 1.22.1
Timeline
- 2026-05-25: advisory: GitHub Security Advisory published
- 2026-06-19: disclosed: CVE published to NVD
- 2026-06-19: patched: Version 1.22.1 released