CVE-2026-32740: Heap-buffer overflow in libheif grid tile compositing
- Vendor
- Struktur AG
CVE-2026-32740 is a heap-buffer-overflow write vulnerability in libheif versions 1.21.2 and earlier. The HeifPixelImage::copy_image_to() function incorrectly handles chroma-row calculations when compositing HEIF or AVIF grid images with 4:2:0 chroma planes. A crafted image containing a 1×4 grid of odd-height tiles can cause 64 bytes of attacker-controlled Cb/Cr pixel data to be written beyond a chroma-plane heap allocation. The flaw is triggered during normal decoding with the default build configuration and can cause memory corruption, application crashes, or potentially arbitrary code execution. It is fixed in libheif 1.22.0.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation corrupts adjacent heap memory with attacker-controlled pixel values, potentially causing denial of service or enabling control-flow hijacking. A reproducible, build-specific Next.js/sharp laboratory chain combines the overflow with a separate returned-pixel information disclosure, corruption of an image-plane map, and a Global Offset Table overwrite to execute attacker-supplied native code. This demonstrates potential compromise of confidentiality, integrity, and availability under the image-processing process's privileges, but does not establish reliable code execution across arbitrary deployments or exploitation in the wild.
Mitigation
If you can’t patch tonight, do this now.
Until patched, reject untrusted HEIF and AVIF files before native decoding, or disable support for these formats. Isolate necessary image processing in disposable, least-privileged workers with restricted network access, minimal writable storage, and no application secrets. Validate uploaded file signatures and prevent uploaded executable content from being loaded as native modules. Monitor image-processing crashes and unexpected native-module loads. These containment measures do not correct the underlying out-of-bounds write.
Remediation
Patch, then assume compromise.
Upgrade to libheif 1.22.0 or later, or install a distribution package containing the backported fix. Identified package fixes include Debian stable version 1.19.8-1+deb13u1 and Echo version 1.19.8-1+e3; Gentoo's broader security advisory recommends 1.23.7 or later. Rebuild or replace sharp, libvips, and other components that bundle vulnerable libheif libraries. Verify the native library actually loaded by production image-processing processes rather than relying solely on top-level application package versions.
Exploits
1 exploit validated by Mallory's analysis.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2026-32740 exploited in the wild?
- As of Nov 11, 2026, Mallory has no reports of CVE-2026-32740 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-32740?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2026-32740, the earliest disclosed Sep 24, 2026.
- Is there a patch for CVE-2026-32740?
- Upgrade to libheif 1.22.0 or later, or install a distribution package containing the backported fix. Identified package fixes include Debian stable version 1.19.8-1+deb13u1 and Echo version 1.19.8-1+e3; Gentoo's broader security advisory recommends 1.23.7 or later.
- What products are affected by CVE-2026-32740?
- Struktur AG Libheif.
- How severe is CVE-2026-32740?
- CVE-2026-32740 has a CVSS v3.1 score of 8.8 (High) and an EPSS score of 0.68% (53rd percentile) as of Nov 11, 2026.
Recent activity
21 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.