Heap-based buffer overflow in libheif - CVE-2026-32741
Published: May 20, 2026
libheif
Detailed vulnerability description
The vulnerability allows a remote attacker to cause a denial of service and potentially execute arbitrary code.
The vulnerability exists due to heap-based buffer overflow in MaskImageCodec::decode_mask_image() in libheif/image-items/mask_image.cc when parsing a crafted HEIF file containing a mask image. A remote attacker can supply a specially crafted HEIF file with an oversized iloc extent to cause a denial of service and potentially execute arbitrary code.
User interaction is required to open or process the crafted HEIF file. Exploitation requires an mski item with mskC bits_per_pixel set to 8 and image properties that enter the single-memcpy branch where stride equals width.