CVE-2026-32741 Details
Description
libheif is a HEIF and AVIF file format decoder and encoder. Versions 1.21.2 and below contain a heap buffer overflow in MaskImageCodec::decode_mask_image(). When decoding a HEIF file containing a mask image (mski), the function copies the full iloc extent data into a pixel buffer using memcpy(dst, data.data(), data.size()). The copy length data.size() is determined by the iloc extent in the file (attacker-controlled), while the destination buffer is sized based on the declared image dimensions. Because no upper-bound check exists on the data length, a crafted file whose iloc extent exceeds the pixel buffer allocation overflows the heap. The vulnerable single-memcpy branch is reached when the mskC property specifies bits_per_pixel = 8 and the ispe property declares an even width ≥ 64 (so that stride == width), with no changes to default security limits or external codec plugins required. This issue has been fixed in version 1.22.0.
A heap buffer overflow vulnerability has been identified in libheif versions through 1.21.2, specifically within the MaskImageCodec::decode_mask_image() function. This vulnerability arises when the decoder processes a HEIF file containing a mask image (mski). The issue occurs because the function uses memcpy to transfer data from the iloc extent into a pixel buffer, without proper validation of the data length. The iloc extent, which is controlled by the attacker, can be manipulated to exceed the allocated buffer size, leading to a heap overflow. The vulnerability is triggered when the mskC property indicates 8 bits per pixel, and the ispe property specifies an even width of 64 or more, allowing the iloc extent to overflow the buffer allocation.
Users can upgrade to libheif version 1.22.0 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed May 19, 2026CISA-ADP
Assessed May 20, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://access.redhat.com/security/cve/CVE-2026-32741 | redhat-SADP | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2480002 | redhat-SADP | |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32741.json | redhat-SADP | |
| https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q | CISA-ADP | AdvisoryExploitRemedyVendor |
| https://github.com/strukturag/libheif/releases/tag/v1.22.0 | [email protected] | Release NotesVendor |
| https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | redhat-SADP |
| CWE-122 | Heap-based Buffer Overflow | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| libheif | <= 1.21.2 (semver) |
CPE
Remediation
| |
Change History
7 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 24, 2026 | CVE Translated | [email protected] |
| Jul 15, 2026 | CVE Modified | redhat-SADP |
| Jun 30, 2026 | CVE Modified | redhat-SADP |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | [email protected] |
| May 20, 2026 | CVE Modified | CISA-ADP |
| May 19, 2026 | New CVE Received | [email protected] |
Volerion