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: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

libheif, a popular HEIF/AVIF decoder and encoder, contains an unbounded heap allocation flaw. The sequence parser fails to enforce a limit on sample_count when the HEIF sequence is in fixed‑size mode, allowing an image crafted with the msf1 brand to instruct the library to allocate gigabytes of memory. The overflow can cause the process to crash or stall due to memory exhaustion. The weakness is identified 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 18, 2026 at 23:51 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 18, 2026 at 23:51 UTC.

Tracking

Sign in to view the affected projects.

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

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

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-18T21:18:03.652Z

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

Link: CVE-2026-50142

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

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

Link: CVE-2026-50142

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-19T00:00:04Z

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

  • CWE-770

    Allocation of Resources Without Limits or Throttling