Description
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, the inline mask parsing code in `libheif/region.cc` contains an integer overflow. Both `width` and `height` are `unsigned int` (32-bit) values parsed from the HEIF file. Their product can exceed `UINT32_MAX`, wrapping to a small value before the division by 8. This causes an undersized buffer allocation, leading to out-of-bounds memory access when the mask data is later interpreted as a `width x height` bitmap. Version 1.22.0 patches the issue.
Published: 2026-07-21
Score: 6.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability stems from an integer overflow (CWE-190) in libheif's inline mask parsing code within libheif/region.cc. When decoding HEIF or AVIF files, the program reads unsigned 32-bit width and height values from the file, multiplies them, and then divides by 8 to determine the mask buffer size. If the product exceeds the maximum 32-bit value, it wraps around to a small number before the division, resulting in an undersized buffer that is later accessed beyond its bounds when the mask is treated as a width × height bitmap. This flaw can lead to memory corruption or crashes, impacting the integrity or availability of the application parsing the files.

Affected Systems

The affected product is libheif, developed by strukturag. Versions 1.21.2 and earlier are impacted, while the issue is patched starting with version 1.22.0.

Risk and Exploitability

The CVSS score of 6.1 indicates moderate severity. EPSS is below 1%, showing a low likelihood of exploitation, and the vulnerability is not listed in CISA KEV. The likely attack vector is the delivery of a crafted HEIF/AVIF file to an application that uses libheif to decode media. Exploitation requires file manipulation but does not necessarily allow control over the process.

Generated by OpenCVE AI on July 30, 2026 at 16:19 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade libheif to 1.22.0 or later.
  • If upgrading is not immediately possible, disable HEIF/AVIF decoding for untrusted input or run the decoder in a sandboxed environment.
  • For applications unable to upgrade quickly, replace the vulnerable inline mask allocation code with a bounds‑checked implementation that validates the product of width and height before allocating memory.

Generated by OpenCVE AI on July 30, 2026 at 16:19 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DSA Debian DSA DSA-6417-1 libheif security update
Ubuntu USN Ubuntu USN USN-8526-1 libheif vulnerabilities
Ubuntu USN Ubuntu USN USN-8526-2 libheif vulnerabilities
History

Mon, 27 Jul 2026 23:30:00 +0000

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

Wed, 22 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 21 Jul 2026 21:15:00 +0000

Type Values Removed Values Added
Description libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, the inline mask parsing code in `libheif/region.cc` contains an integer overflow. Both `width` and `height` are `unsigned int` (32-bit) values parsed from the HEIF file. Their product can exceed `UINT32_MAX`, wrapping to a small value before the division by 8. This causes an undersized buffer allocation, leading to out-of-bounds memory access when the mask data is later interpreted as a `width x height` bitmap. Version 1.22.0 patches the issue.
Title libheif has integer overflow in inline mask size calculation that causes undersized buffer allocation
Weaknesses CWE-190
References
Metrics cvssV3_1

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


Subscriptions

Struktur Libheif
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-22T13:37:10.052Z

Reserved: 2026-05-19T21:29:25.482Z

Link: CVE-2026-47714

cve-icon Vulnrichment

Updated: 2026-07-22T13:33:28.947Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T16:30:05Z

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound