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: 7 [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]
CVE-ID: CVE-2026-32741
CWE-ID: CWE-122
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

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.


Affected software

libheif
Debian Linux
libheif (Debian package)

How to mitigate CVE-2026-32741

Install security update from vendor's website.

libheif - update to 1.22.0
libheif (Debian package) - update to 1.19.8-1+deb13u1

External References

Related Security Bulletins