CVE-2026-41069 Overview
CVE-2026-41069 is an out-of-bounds read vulnerability [CWE-125] in libheif, the HEIF and AVIF file format decoder and encoder maintained by struktur. The flaw affects versions 1.21.2 and prior. A malformed HEIF sequence file triggers an out-of-bounds read in the core sequence parsing logic, resulting in denial of service. The vulnerability resides in the SampleAuxInfoReader constructor, which enters its processing loop when saiz.sample_count > 0 even if stco.entry_count == 0 produces zero chunks. Applications that decode untrusted HEIF or AVIF content using libheif are exposed to crashes when processing attacker-supplied files.
Critical Impact
Remote attackers can crash applications that parse untrusted HEIF sequence files, producing reliable denial of service against image processing pipelines, browsers, and media servers built on libheif.
Affected Products
- struktur libheif versions 1.21.2 and prior
- Applications embedding libheif for HEIF or AVIF decoding
- Server-side image processing pipelines that accept HEIF sequence files
Discovery Timeline
- 2026-05-22 - CVE-2026-41069 published to the National Vulnerability Database
- 2026-05-27 - Last updated in NVD database
Technical Details for CVE-2026-41069
Vulnerability Analysis
The vulnerability stems from inconsistent validation between three related ISO Base Media File Format boxes during HEIF sequence parsing. The stco (Chunk Offset Box), saio (Sample Auxiliary Information Offsets Box), and saiz (Sample Auxiliary Information Sizes Box) values must remain consistent for safe iteration. A malformed file can set stco.entry_count == 0, creating no chunk entries, while still passing validation because saio.entry_count == 0 matches. When saiz.sample_count > 0, the SampleAuxInfoReader constructor still enters its loop. The loop dereferences chunks[0] in chunked mode, but the chunks vector is empty. This produces an out-of-bounds read and triggers a crash in the host process.
Root Cause
The root cause is missing cross-field validation in the SampleAuxInfoReader constructor. The code trusts that a non-zero saiz.sample_count implies the existence of at least one chunk in chunked mode. No precondition check confirms that chunks contains elements before indexing position zero.
Attack Vector
An attacker crafts a malformed HEIF sequence file with the inconsistent box values described above. The attacker delivers the file to a target application through a web upload, email attachment, messaging client, or any workflow that decodes HEIF content. User interaction is required to open or process the file. Successful exploitation crashes the decoding process and disrupts availability. Confidentiality and integrity are not directly impacted.
No verified public exploit code is available. Refer to the GitHub Security Advisory GHSA-p82x-fpmv-576r for upstream technical details.
Detection Methods for CVE-2026-41069
Indicators of Compromise
- Repeated crashes or segmentation faults in processes linked against libheif when handling user-supplied images
- HEIF or AVIF files containing stco boxes with entry_count == 0 paired with saiz boxes where sample_count > 0
- Image processing workers terminating abnormally shortly after ingesting HEIF sequence content
Detection Strategies
- Inventory deployed binaries and container images for libheif versions at or below 1.21.2 using software composition analysis tooling
- Inspect HEIF sequence files at upload boundaries and flag inconsistencies between stco.entry_count, saio.entry_count, and saiz.sample_count
- Correlate process crash telemetry with preceding HEIF or AVIF file handling events to identify exploitation attempts
Monitoring Recommendations
- Enable crash dump collection on services that decode user-submitted images and forward dumps to centralized analysis
- Alert on abnormal restart rates for image processing workers, browser tabs, or thumbnail generators
- Track inbound file uploads with HEIF or AVIF MIME types and retain samples for forensic review
How to Mitigate CVE-2026-41069
Immediate Actions Required
- Upgrade libheif to version 1.22.0 or later across all systems, container images, and bundled application dependencies
- Restart any long-running services that load libheif so the patched library is mapped into memory
- Restrict upload of HEIF and AVIF content from untrusted sources until patched versions are deployed
Patch Information
struktur released the fix in libheif version 1.22.0. See the GitHub Release v1.22.0 notes and the GitHub Security Advisory GHSA-p82x-fpmv-576r for upstream guidance. Distribution-provided packages should be updated as backports become available.
Workarounds
- Disable HEIF and AVIF decoding in applications where the formats are not required
- Sandbox image decoding workers and configure automatic restart on crash to limit denial of service impact
- Pre-validate HEIF sequence files and reject inputs where stco.entry_count == 0 while saiz.sample_count > 0
# Verify installed libheif version and upgrade where required
dpkg -l | grep libheif
apt-get update && apt-get install --only-upgrade libheif1
# For container images, pin the patched release
# RUN apt-get update && apt-get install -y libheif1=1.22.0-*
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

