CVE-2026-50142 libheif: unbounded heap allocation in HEIF sequence parser (stsz fixed-size mode missing bound check)

High 7.5 Published Updated

A crafted HEIF file can cause unbounded heap allocation and memory exhaustion in libheif, leading to a denial of service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-50142?

CVE-2026-50142 is a high-severity denial of service vulnerability in strukturag libheif, published on 18 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-770, CWE-190

Which versions are affected by CVE-2026-50142?

How do I fix CVE-2026-50142?

Upgrade to a fixed version.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-50142 being exploited?

There is no known exploitation of CVE-2026-50142 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as ALPINE-CVE-2026-50142, BELL-CVE-2026-50142, DEBIAN-CVE-2026-50142, GHSA-jvmp-j3cw-84mh, MINI-9mgj-9mwg-95c2, ROOT-OS-DEBIAN-12-CVE-2026-50142 and 1 more.

Is CVE-2026-50142 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free