Description
libheif is a HEIF and AVIF file format decoder and encoder. From 1.19.0 until 1.23.0, a crafted HEIF sequence accepted by heif_context_read_from_memory() with the msf1 sequence brand can cause unbounded heap allocation. In libheif/sequences/seq_boxes.cc, Box_stsz::parse() applies max_sequence_frames only to variable-size samples, so fixed-size mode accepts an attacker-controlled sample_count without a bound. In libheif/sequences/track.cc, Track::load() also adds current_sample_idx and samples_per_chunk in 32-bit arithmetic, allowing the consistency check to be bypassed by wraparound. The resulting values reach the Chunk::Chunk() allocation path, which can consume gigabytes of memory and crash or stall the process through memory exhaustion. This issue is fixed in version 1.23.0.
Published: 2026-08-18
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

libheif, a widely used HEIF/AVIF decoder and encoder, contains a flaw that allows an attacker to trigger unbounded heap allocations. The sequence parser in fixed‑size mode fails to limit the sample_count parameter when parsing an HEIF sequence with the msf1 brand, so the library can be instructed to allocate gigabytes of memory. Additionally, the Track::load function performs 32‑bit arithmetic when adding current_sample_idx and samples_per_chunk, enabling a wraparound that bypasses the consistency check. These issues permit the allocation of excessive memory in the Chunk constructor, leading to out‑of‑memory crashes or process stalls. The vulnerability is categorized as an integer overflow (CWE‑190) and an unbounded array allocation (CWE‑770).

Affected Systems

The vulnerability affects strukturag libheif versions from 1.19.0 up to, but not including, 1.23.0. Applications or services that integrate these library versions and process untrusted HEIF files are potentially impacted. Versions 1.23.0 and later contain the fix and are not affected.

Risk and Exploitability

The CVSS score is 7.5, indicating a highly severe impact. No EPSS score is available, and the vulnerability is not listed in the CISA KEV catalog. Attackers can trigger the flaw by supplying a carefully crafted HEIF file with a malicious sample_count and msf1 brand. The exploit requires the target to successfully parse such a file, which can be achieved in any context where the application accepts or decodes HEIF images from external sources. The exploit is local to the process running libheif but can lead to a denial of service or potential system instability through uncontrolled memory consumption.

Generated by OpenCVE AI on August 19, 2026 at 09:14 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade libheif to version 1.23.0 or later as released by strukturag
  • If an upgrade cannot be applied immediately, configure a runtime memory limit for processes that use libheif (e.g., via cgroups or container limits) to contain resource consumption
  • Restrict the acceptance of HEIF files from untrusted sources, and validate inputs to reject files with anomalously large sample_count or the msf1 brand

Generated by OpenCVE AI on August 19, 2026 at 09:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Ubuntu USN Ubuntu USN USN-8526-1 libheif vulnerabilities
History

Fri, 21 Aug 2026 21:15:00 +0000

Type Values Removed Values Added
First Time appeared Struktur
Struktur libheif
Vendors & Products Struktur
Struktur libheif

Wed, 19 Aug 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 18 Aug 2026 21:30:00 +0000

Type Values Removed Values Added
Description libheif is a HEIF and AVIF file format decoder and encoder. From 1.19.0 until 1.23.0, a crafted HEIF sequence accepted by heif_context_read_from_memory() with the msf1 sequence brand can cause unbounded heap allocation. In libheif/sequences/seq_boxes.cc, Box_stsz::parse() applies max_sequence_frames only to variable-size samples, so fixed-size mode accepts an attacker-controlled sample_count without a bound. In libheif/sequences/track.cc, Track::load() also adds current_sample_idx and samples_per_chunk in 32-bit arithmetic, allowing the consistency check to be bypassed by wraparound. The resulting values reach the Chunk::Chunk() allocation path, which can consume gigabytes of memory and crash or stall the process through memory exhaustion. This issue is fixed in version 1.23.0.
Title libheif: unbounded heap allocation in HEIF sequence parser (stsz fixed-size mode missing bound check)
Weaknesses CWE-190
CWE-770
References
Metrics cvssV3_1

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


Subscriptions

Struktur Libheif
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-19T18:51:48.615Z

Reserved: 2026-06-03T18:49:32.275Z

Link: CVE-2026-50142

cve-icon Vulnrichment

Updated: 2026-08-19T18:51:45.412Z

cve-icon NVD

Status : Received

Published: 2026-08-18T22:16:52.633

Modified: 2026-08-19T19:17:18.057

Link: CVE-2026-50142

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-21T21:00:03Z

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

  • CWE-770

    Allocation of Resources Without Limits or Throttling