CVE-2026-32741
libheif has a heap buffer overflow in decode_mask_image()
Reported by github_m · Published May 19, 2026
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| libheif-tools | Amazon Linux | 1.19.8-1.amzn2023.0.5 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| strukturag | libheif | < 1.22.0 |
| Red Hat | Red Hat Enterprise Linux 10 | |
| amazon:2023 | libheif-tools | 0 |
| strukturag | libheif | 0 |
| amazon:2023 | heif-pixbuf-loader | 0 |
| amazon:2023 | libheif-devel | 0 |
| Red Hat | Red Hat Enterprise Linux 10 | |
| amazon:2023 | libheif | 0 |
Timeline
- May 19, 2026 CVE Published
- May 19, 2026 PoC Published
- May 20, 2026 EPSS Score (30 in total, the first dated here)
- May 20, 2026 Coalition ESS Score
- Jul 24, 2026 CVE Updated
- Sep 21, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-32741
vulnetix vdb fixes CVE-2026-32741
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-32741/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q x_refsource_CONFIRM
- https://github.com/strukturag/libheif/releases/tag/v1.22.0 x_refsource_MISC
- RHBZ#2480002 issue
- https://access.redhat.com/security/cve/CVE-2026-32741 advisory
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32741.json advisory