libheif has a heap buffer overflow in decode_mask_image()
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- None · Low · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| strukturag | libheif | before 1.22.0 | 1.22.0 | Patch available | CNA |
- libheif Vendorstrukturag Affected before 1.22.0 Fixed in 1.22.0 Patch available CNA
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:struktur:libheif:*:*:*:*:*:*:*:* | — | — | strukturag |
- cpe:2.3:a:struktur:libheif:*:*:*:*:*:*:*:* Versions — — ·strukturag
Remediation
- Fix · CNA libheif (strukturag) Fixed in 1.22.0
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
Not affected: 1 product
- Red Hat Enterprise Linux 10
Timeline
- 2026-10-02 Threatist record created from CVE-2026-32741
References
More strukturag vulnerabilities
- TI-2026-57994 libheif: Heap buffer overflow in `scale_nearest_neighbor()` via duplicate Alpha planes from nested `iden`/`auxl` items CVSS 3.1CRITICAL 9.8
- TI-2026-25594 NULL Pointer Dereference in libde265 CVSS 4.0HIGH 8.7
- TI-2023-27026 Libde265 v1.0.14 was discovered to contain a global buffer overflow vulnerability in the… CVSS 3.1HIGH 8.8
- TI-2023-27020 libheif v1.17.5 was discovered to contain a segmentation violation via the function… CVSS 3.1HIGH 8.8
- TI-2026-58037 Resource allocation without limits in strukturag libheif CVSS 3.1HIGH 7.5
- TI-2026-57995 libheif: brotli/zlib decompression paths lack output-size limits, allowing decompression-bomb OOM/DoS CVSS 3.1HIGH 7.5
Sources
- CVE-2026-32741 · CVE Program
- CVE-2026-32741 · NVD
- FIRST EPSS
- CVE-2026-32741 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences