CVE-2026-32739
Description
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and below, a crafted 800-byte HEIF sequence file causes an infinite loop in Box_stts::get_sample_duration(), consuming 100% CPU indefinitely with zero progress, leading to DoS. The loop has no iteration limit or timeout and is triggered during file open (parsing) - before any user interaction or image decoding. The process stays alive (no crash, no error logged), making it invisible to crash-based monitoring. This issue has been fixed in version 1.22.0.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In libheif ≤1.21.2, a crafted HEIF sequence file triggers an infinite loop in Box_stts::get_sample_duration(), causing a CPU-based denial of service via file parsing before any user interaction.
Vulnerability
A missing loop-variable increment in Box_stts::get_sample_duration() (in libheif/sequences/seq_boxes.cc, lines 622–631) causes an infinite loop when m_entries[0].sample_count equals 0. The function iterates while (i < m_entries.size()) but i is never incremented; when sample_idx -= 0 is a no-op in unsigned arithmetic, the loop repeats forever. The same pattern exists in Box_ctts::get_sample_offset(). Versions 1.21.2 and below are affected. A crafted 800‑byte HEIF sequence file can bypass a consistency check by using two stts entries (entry[0] with sample_count=0 and entry[1] with sample_count=2) so that the sum still matches the required sample count, allowing the vulnerable code path to be reached during file opening [2].
Exploitation
An attacker needs only the ability to supply a crafted HEIF sequence file to a target (e.g., via a download, email attachment, or web‑based image processing service). No authentication, user interaction beyond file open, or special network position is required. The file triggers the parsing chain: heif_context_read_from_file() → HeifContext::interpret_heif_file() → Track::alloc_track() → Track::load() → init_sample_timing_table() → Box_stts::get_sample_duration(), which then loops infinitely [2]. The same missing‑increment bug in Box_ctts::get_sample_offset() provides a second attack surface.
Impact
The process spins at 100% CPU with zero progress and does not crash or log an error, making the denial‑of‑service invisible to crash‑based monitoring. The infinite loop occurs before any image decoding or user interaction, so the target application becomes permanently unresponsive until forcibly terminated. The impact is limited to availability (DoS); no data is disclosed or modified.
Mitigation
The issue is fixed in libheif version 1.22.0 [1]. Users should upgrade to 1.22.0 or later. There is no known workaround for versions 1.21.2 and below. No KEV listing has been published as of the advisory date.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2(expand)+ 1 more
- (no CPE)
- (no CPE)range: <=1.21.2
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
2- github.com/strukturag/libheif/security/advisories/GHSA-j9g7-q9hv-gq8cnvdExploitVendor Advisory
- github.com/strukturag/libheif/releases/tag/v1.22.0nvdRelease Notes
News mentions
0No linked articles in our index yet.