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

Published Aug 18, 2026
·
Updated

Last updated 10 July 2026

Other sources

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 heifcontextreadfrommemory() with the msf1 sequence brand can cause unbounded heap allocation. In libheif/sequences/seqboxes.cc, Boxstsz::parse() applies maxsequenceframes only to variable-size samples, so fixed-size mode accepts an attacker-controlled samplecount without a bound. In libheif/sequences/track.cc, Track::load() also adds currentsampleidx and samplesperchunk 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.

MITRE

Affected Software

1 affected componentFixes available
debian/libheif<=1.11.0-1, <=1.11.0-1+deb11u2, <=1.15.1-1+deb12u1, <=1.19.8-1, <=1.21.2-4
1.23.1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/libheif to a version that resolves this vulnerability.

    Fixed in 1.23.1-1
  2. Upgrade

    Upgrade libheif to a version that resolves this vulnerability.

    Fixed in 1.23.0

Event History

Jul 9, 2026
Data Sourced
via Debian·09:52 PM
DescriptionAffected Software
Jul 11, 2026
Data Sourced
via Ubuntu·09:54 PM
RemedyDescriptionSeverityAffected Software
Aug 18, 2026
CVE Published
via MITRE·09:18 PM
Data Sourced
via MITRE·09:18 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are realistically exposed?

Applications that call heif_context_read_from_memory() on attacker-controlled HEIF data are exposed when the input uses the msf1 sequence brand. The vulnerable behavior can consume gigabytes of memory, causing the process to stall or crash through memory exhaustion.

2

What does an attacker need to exploit this issue?

An attacker only needs to provide a crafted HEIF sequence; no authentication, user interaction, or special configuration is indicated. The affected parser accepts an attacker-controlled sample_count in fixed-size mode without applying the sequence-frame limit.

3

What version should be deployed to remediate the vulnerability?

Update libheif to version 1.23.0, which fixes the issue. The affected version range is 1.19.0 through versions before 1.23.0.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203