Impact
libheif contains a heap buffer overflow in the MaskImageCodec::decode_mask_image() function. When a HEIF file contains a mask image with an attacker‑controlled iloc extent, the copy length supplied to memcpy exceeds the size of the allocated pixel buffer. The resulting memory corruption can lead to arbitrary code execution or a denial‑of‑service. The vulnerability is triggered by a single memcpy branch that is reached when bits_per_pixel equals 8 and the image width is even and at least 64 pixels, without requiring changes to security limits or external plugins. It is inferred that any application that decodes HEIF/AVIF files using libheif is potentially exposed.
Affected Systems
Vendors: strukturag – libheif. Affected product versions: 1.21.2 and all earlier releases. The issue is resolved in libheif version 1.22.0 and later.
Risk and Exploitability
The CVSS score of 7.1 indicates a medium‑to‑high severity vulnerability. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. It is inferred that the likely attack vector is delivery of a crafted HEIF file to an application that uses libheif for decoding—such as image viewers, editors, or web browsers—allowing an attacker to trigger the overflow by simply opening or processing the malicious file. No additional exploitation prerequisites beyond providing the malformed file are cited in the CVE description.
OpenCVE Enrichment