CVE-2026-41069

libheif allows Out-of-bounds vector access leading to invalid dereference (DoS)

Published May 22, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, a malformed HEIF sequence file can trigger an out-of-bounds read in core sequence parsing logic, causing DoS. A malformed file can have stco.entry_count == 0 (creating no chunks) while still passing validation because saio.entry_count == 0 matches, but with saiz.sample_count > 0 the SampleAuxInfoReader constructor still enters its loop. This leads to an out-of-bounds dereference on the empty chunks[0] in chunked mode.

Analysis

AI-generated

Technical impact

The flaw is an out‑of‑bounds read and invalid dereference triggered when libheif parses a malformed HEIF sequence file. The buggy core sequence parser allows a file with stco.entry_count set to zero to bypass validation because saio.entry_count is also zero, yet SampleAuxInfoReader continues to loop when saiz.sample_count is greater than zero. The loop then dereferences chunks[0] although no chunks exist, causing a crash and denial of service. This weakness is catalogued as CWE‑125 (Out‑of‑Bounds Read) and CWE‑476 (Dereference of Null Pointer).

Affected Systems

The issue afflicts libheif version 1.21.2 and earlier, an open‑source HEIF and AVIF decoder/encoder maintained by strukturag. Any application that links against these affected releases—including image viewers, media libraries, and server uploads—could be impacted, as the vulnerable code resides in the core sequence parsing logic common to all such uses.

Risk and Exploitability

The vulnerability carries a CVSS score of 6.5, indicating a moderate severity. Because EPSS data is not available, the exploitation likelihood cannot be quantified precisely, but the fact that an attacker can supply any HEIF file means the problem is readily exploitable if the target processes external uploads or content. The issue has not been added to CISA’s KEV catalog, and no public exploit is currently documented. Mitigation is to upgrade to libheif 1.22.0 or later, which removes the out‑of‑bounds dereference.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to libheif 1.22.0 or later, which contains the fix for the out‑of‑bounds dereference.
  • Validate HEIF input before parsing; reject files where stco.entry_count is zero but saiz.sample_count is non‑zero, or enforce strict size limits.
  • Implement defensive coding around the SampleAuxInfoReader constructor to guard against empty chunks arrays.

Generated by OpenCVE AI on May 22, 2026 at 22:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8454-1 libheif vulnerabilities
History
Type Values Removed Values Added
CPEs cpe:2.3:a:struktur:libheif:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Struktur
Struktur libheif
Vendors & Products Struktur
Struktur libheif
Type Values Removed Values Added
Description libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, a malformed HEIF sequence file can trigger an out-of-bounds read in core sequence parsing logic, causing DoS. A malformed file can have stco.entry_count == 0 (creating no chunks) while still passing validation because saio.entry_count == 0 matches, but with saiz.sample_count > 0 the SampleAuxInfoReader constructor still enters its loop. This leads to an out-of-bounds dereference on the empty chunks[0] in chunked mode.
Title libheif allows Out-of-bounds vector access leading to invalid dereference (DoS)
Weaknesses CWE-125
CWE-476
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 26, 2026, 12:16 PM
Reserved
Apr 16, 2026, 4:43 PM
Status
Analyzed
Published
May 22, 2026, 9:16 PM
Modified
Jul 23, 2026, 11:10 AM