# CVE-2026-32740: Strukturag libheif heap buffer overflow in grid tile compositing

Source: https://junglewise.ai/threats/cve-2026-32740-strukturag-libheif-heap-buffer-overflow-in-grid-tile-compositing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-19. Updated: 2026-05-19  
License: CC BY 4.0 with a link back

CVE-2026-32740 · Severity: high · CVSS 8.8 · Published 2026-05-19

libheif is a software library used by many applications to process HEIF and AVIF image files. A security flaw in how the library handles certain image layouts allows a malicious image file to corrupt the computer's memory when the image is opened or previewed. This could allow an attacker to crash the application or potentially take control of the system, leading to data theft or unauthorized access.

Technologies: [struktur AG Libheif](https://junglewise.ai/threats/technologies/libheif). Vendors: [struktur AG](https://junglewise.ai/threats/vendors/struktur-ag).

## Quick answers

**Is CVE-2026-32740 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-32740 being exploited in the wild.

**How severe is CVE-2026-32740?** High severity, with a CVSS score of 8.8, published 19 May 2026.

**Which products and versions are affected?** struktur AG Libheif <= 1.21.2.

**Is there a fix for CVE-2026-32740?** A patch was published on 2026-05-19: Fixed in version 1.22.0 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-32740 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-32740?** Check whether you run struktur AG Libheif at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A heap-based buffer overflow exists in libheif versions 1.21.2 and prior within the HeifPixelImage::copy_image_to() function in pixelimage.cc. The vulnerability is caused by a rounding mismatch during the calculation of chroma plane offsets and copy heights when processing YCbCr 4:2:0 images with specific grid configurations (e.g., a 1x4 grid of odd-height tiles). An attacker can exploit this by providing a crafted HEIF/AVIF file that, when decoded, writes 64 bytes of attacker-controlled chroma pixel data past the end of a heap allocation. This can lead to heap corruption, denial of service, or remote code execution through heap grooming. The issue is fixed in version 1.22.0.

## Affected products

- strukturag libheif <= 1.21.2

## Timeline

- 2026-05-19: disclosed
- 2026-05-19: patched: Fixed in version 1.22.0
- 2026-05-19: advisory

## References

- [https://github.com/strukturag/libheif/releases/tag/v1.22.0](https://github.com/strukturag/libheif/releases/tag/v1.22.0)
- [https://github.com/strukturag/libheif/security/advisories/GHSA-frfr-f3vg-2g6j](https://github.com/strukturag/libheif/security/advisories/GHSA-frfr-f3vg-2g6j)

## Related threats

- [libheif decompression bomb via brotli/zlib metadata](https://junglewise.ai/threats/cve-2026-84384-libheif-is-a-heif-and-avif-file-format-decoder-and-encoder-from-1)
- [Strukturag libheif heap OOB read in ImageItem_Grid::decode_grid_tile](https://junglewise.ai/threats/cve-2026-48029-strukturag-libheif-heap-oob-read-in-imageitem-grid-decode-grid)
- [Strukturag libheif integer overflow in region.cc mask parsing](https://junglewise.ai/threats/cve-2026-47714-strukturag-libheif-integer-overflow-in-region-cc-mask-parsing)
- [Strukturag libheif heap buffer over-read in SampleAuxInfoReader](https://junglewise.ai/threats/cve-2026-41071-strukturag-libheif-heap-buffer-over-read-in-sampleauxinforeader)
- [Strukturag libheif out-of-bounds read in SampleAuxInfoReader](https://junglewise.ai/threats/cve-2026-41069-strukturag-libheif-out-of-bounds-read-in-sampleauxinforeader)
