# CVE-2026-32741: libheif has a heap buffer overflow in decode\_mask\_image()

- Priority: **Routine**
- Reason: Not severe (CVSS 7.1, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-05-19 · Modified: 2026-07-15
- Aliases: UBUNTU-CVE-2026-32741, DEBIAN-CVE-2026-32741
- Record: https://cvemate.com/vulnerability/CVE-2026-32741 · JSON: https://cvemate.com/vulnerability/CVE-2026-32741/json

## Description

```text
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.
```

## Signals

- CVSS: 7.1 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H
- EPSS: 0.46%, percentile 41.603%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian libheif (Debian): All versions (No fix recorded) \| \< 1.19.8-1+deb13u1 \| \< 1.23.1-1
- ubuntu libheif (Ubuntu): \< 1.17.6-1ubuntu4.4 \| \< 1.20.2-1ubuntu0.4 \| \< 1.21.2-3ubuntu0.1
- strukturag libheif: \< 1.22.0

## References

- <https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q>
- <https://github.com/strukturag/libheif/releases/tag/v1.22.0>
- <https://access.redhat.com/security/cve/CVE-2026-32741>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2480002>
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32741.json>
- <https://ubuntu.com/security/CVE-2026-32741>
- <https://www.cve.org/CVERecord?id=CVE-2026-32741>
- <https://ubuntu.com/security/notices/USN-8454-1>
- <https://security-tracker.debian.org/tracker/CVE-2026-32741>

---

Data as of 2026-12-05T10:01:58.838Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
