CVE-2026-47178 Overview
CVE-2026-47178 is a heap out-of-bounds write [CWE-787] in libheif, an open-source HEIF and AVIF file format decoder and encoder maintained by struktur AG. The flaw affects versions 1.19.0 through 1.21.2 and is triggered when the library parses a crafted HEIF file that uses the uncompressed unci codec with tiled, component-interleaved, 4:2:0 layout. The write corrupts the C++ vtable pointer of an adjacent unc_decoder_component_interleave object. The next virtual method call then dispatches to an attacker-controlled address, enabling arbitrary code execution in the process that decoded the file. Version 1.22.0 patches the issue.
Critical Impact
A single malicious HEIF image can hijack control flow in any application that links libheif for image decoding, including image viewers, thumbnailers, and media pipelines.
Affected Products
- libheif 1.19.0 through 1.21.2
- Applications and services that link vulnerable libheif versions for HEIF/AVIF decoding
- Downstream Linux distributions and image processing pipelines bundling libheif in the affected range
Discovery Timeline
- 2026-07-21 - CVE-2026-47178 published to NVD
- 2026-07-22 - Last updated in NVD database
Technical Details for CVE-2026-47178
Vulnerability Analysis
The flaw resides in libheif's uncompressed tile decoder path, which handles images encoded with the unci (uncompressed) codec. When the input file declares a tiled layout combined with component-interleaved pixel organization and 4:2:0 chroma subsampling, the decoder computes tile buffer bounds incorrectly. Decoding then writes pixel data past the end of the allocated heap region.
The adjacent memory belongs to an unc_decoder_component_interleave object. Because the overwrite lands on the object's C++ vtable pointer, subsequent virtual dispatch calls jump to a location under attacker control. This converts an out-of-bounds write primitive into arbitrary code execution within the decoder process.
The issue is classified under [CWE-787] (Out-of-bounds Write). Exploitation requires user interaction to open or process a crafted file and executes in the local security context of the calling application.
Root Cause
The root cause is missing or incorrect bounds validation in the uncompressed tile decode routine for the component-interleaved, chroma-subsampled configuration. The decoder trusts geometry values derived from the file's unci codec metadata without reconciling them against the true size of the destination tile buffer.
Attack Vector
An attacker crafts a HEIF file that declares unci-encoded, tiled, 4:2:0, component-interleaved image data. The victim opens the file with any application that uses vulnerable libheif, such as a file manager preview, image viewer, or server-side conversion pipeline. Decoding overwrites the neighboring object's vtable pointer, and the next virtual call transfers execution to the attacker's chosen address.
The vulnerability manifests inside the uncompressed tile decoder. Refer to the GitHub Security Advisory GHSA-5x55-x5pf-9c6g for the vendor's technical description and patch details.
Detection Methods for CVE-2026-47178
Indicators of Compromise
- HEIF or HEIC files containing unci codec entries with tiled, component-interleaved, 4:2:0 parameters from untrusted sources
- Crashes or unexpected termination in processes linking libheif shortly after opening image files
- Child processes spawned by image viewers, thumbnailers, or conversion services immediately after HEIF processing
Detection Strategies
- Inventory installed libheif versions across endpoints and servers; flag any instance in the 1.19.0–1.21.2 range
- Inspect HEIF files at gateways and mail filters for unci codec box structures with tiled, interleaved, subsampled geometry
- Correlate image-processing crashes with subsequent execution of shells, scripting interpreters, or network callbacks originating from the same process tree
Monitoring Recommendations
- Alert on segmentation faults or ASAN reports in binaries linked against libheif.so on Linux and libheif.dylib on macOS
- Monitor conversion services and thumbnail workers for anomalous outbound connections following HEIF ingestion
- Log SHA-256 hashes of HEIF/HEIC files processed by public-facing upload endpoints for retrospective hunting
How to Mitigate CVE-2026-47178
Immediate Actions Required
- Upgrade libheif to version 1.22.0 or later on all systems and rebuild dependent applications
- Audit third-party software that bundles libheif and apply vendor updates as they ship the patched library
- Restrict automatic HEIF/HEIC preview generation in file managers and mail clients until patched builds are deployed
Patch Information
The maintainers fixed the out-of-bounds write in libheif version 1.22.0. See the GitHub Security Advisory GHSA-5x55-x5pf-9c6g for the vendor's advisory and commit references. Distribution package maintainers should backport the fix or ship the 1.22.0 release.
Workarounds
- Disable or unload libheif-backed HEIF/AVIF decoders in applications where the format is not required
- Block inbound HEIF and HEIC attachments at mail and web gateways for user populations that do not need them
- Process untrusted images inside sandboxed or containerized workers with no network egress and minimal filesystem access
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

