Heap-based buffer overflow in libheif - CVE-2026-32741

 

Heap-based buffer overflow in libheif - CVE-2026-32741

Published: May 20, 2026


Vulnerability identifier: #VU131978
CSH Severity: Medium
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N/E:U/U:Green
CVE-ID: CVE-2026-32741
CWE-ID: CWE-122
Exploitation vector: Remote access
Exploit availability: No public exploit available
Vendor: struktur AG
Affected software:
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.


How to mitigate CVE-2026-32741

Install security update from vendor's website.

Sources