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

- Priority: **Prioritise**
- Reason: Severe, CVSS 7.5 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 0% (FIRST, 04-12-2026)
- Next step: Check applicability: affected before 1.23.0 (CNA); fix release not confirmed
- Status: published
- Published: 2026-08-18 · Modified: 2026-08-19
- Aliases: ALPINE-CVE-2026-50142, UBUNTU-CVE-2026-50142, DEBIAN-CVE-2026-50142
- Record: https://cvemate.com/vulnerability/CVE-2026-50142 · JSON: https://cvemate.com/vulnerability/CVE-2026-50142/json

## Description

```text
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.
```

## Signals

- CVSS: 7.5 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.495%, percentile 44.075%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine libheif (Alpine Linux): \< 1.23.0-r0
- debian libheif (Debian): All versions (No fix recorded) \| \< 1.23.1-1
- ubuntu libheif (Ubuntu): \< 1.20.2-1ubuntu0.6 \| \< 1.21.2-3ubuntu0.3
- strukturag libheif: ≥ 1.19.0, \< 1.23.0

## References

- <https://github.com/strukturag/libheif/security/advisories/GHSA-jvmp-j3cw-84mh>
- <https://github.com/strukturag/libheif/commit/a6caa38f7a70d66dc9caec2a7bfe20935b32c622>
- <https://github.com/strukturag/libheif/releases/tag/v1.23.0>
- <https://security.alpinelinux.org/vuln/CVE-2026-50142>
- <https://ubuntu.com/security/CVE-2026-50142>
- <https://www.cve.org/CVERecord?id=CVE-2026-50142>
- <https://ubuntu.com/security/notices/USN-8526-1>
- <https://security-tracker.debian.org/tracker/CVE-2026-50142>

---

Data as of 2026-12-05T10:25:25.096Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
