CVE-2026-32814

libheif: Uninitialized Heap Memory Information Leak via Failed Grid Tiles

Published May 19, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, when decoding a HEIF grid image with strict_decoding=false (the default), a corrupted tile silently fails to decode and the library returns heif_error_Ok with no indication of failure, leading to an uninitialized heap memory information leak. The canvas is allocated via create_clone_image_at_new_size() → plane.alloc() → new (std::nothrow) uint8_t[allocation_size] which does not zero the memory; only the alpha plane is explicitly initialized via fill_plane(), so the Y, Cb, and Cr planes contain whatever was previously at that heap address. The failed tile's region of the canvas is never written. It retains uninitialized heap data that is delivered to the caller as decoded pixel values (4,096 bytes per Y/Cb/Cr plane = 12,288+ bytes total). Any application using libheif to decode grid-based HEIF/AVIF files with default settings is vulnerable: a crafted .heic or .avif file causes 4,096+ bytes of heap memory to appear as pixel values in the decoded image, and the calling application receives heif_error_Ok, so it has no indication the output contains heap garbage. In server-side image processing, an uploaded crafted HEIF decoded and re-encoded (e.g., as PNG/JPEG for thumbnails, CDN, social media) can leak cross-user data such as auth tokens, database results, and other users' image data. This issue has been fixed in version 1.22.0.

Analysis

AI-generated

Technical impact

An error condition in libheif 1.21.2 and earlier causes a corrupted HEIF grid tile to silently fail to decode while the library reports success, leaving uninitialized heap data in the Y, Cb, and Cr planes. The resulting decoded image contains 4,096 bytes per plane, totaling over 12 KB of memory that may hold prior user data such as authentication tokens or database results. Because the error is not reported to the caller, applications receive a normal success code and cannot sense that the image is corrupted. This behavior aligns with CWE-200 (Information Exposure) and CWE-908 (Information Leak through Uninitialized Data).

Affected Systems

All users of strukturag:libheif running version 1.21.2 or earlier are affected. The fix was applied in version 1.22.0 and subsequent releases, so any deployment that has not yet upgraded is vulnerable.

Risk and Exploitability

The CVSS score of 6.5 indicates a moderate severity. EPSS information is not available, and the vulnerability is not listed in CISA’s KEV catalog. The primary attack scenario involves an attacker crafting a malicious HEIC or AVIF file and providing it to an application that decodes images, such as a server‑side image processor or thumbnail generator. Because the bug triggers on corrupted grid tiles and does not require elevated privileges, any process that links against libheif can potentially leak sensitive heap contents. In environments where images are generated from untrusted uploads, the risk to confidentiality is moderate to high, depending on the sensitivity of the data previously residing in the heap.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade libheif to version 1.22.0 or later to remove the bug
  • Configure libheif to use strict_decoding=true so that failed grid tiles produce a non‑zero error status and halt processing
  • Add validation to any image‑processing pipeline to reject or re‑process HEIF/AVIF files that return an error or contain unexpected pixel data before further use

Generated by OpenCVE AI on May 19, 2026 at 21:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8454-1 libheif vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Struktur
Struktur libheif
Vendors & Products Struktur
Struktur libheif
Type Values Removed Values Added
Description libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, when decoding a HEIF grid image with strict_decoding=false (the default), a corrupted tile silently fails to decode and the library returns heif_error_Ok with no indication of failure, leading to an uninitialized heap memory information leak. The canvas is allocated via create_clone_image_at_new_size() → plane.alloc() → new (std::nothrow) uint8_t[allocation_size] which does not zero the memory; only the alpha plane is explicitly initialized via fill_plane(), so the Y, Cb, and Cr planes contain whatever was previously at that heap address. The failed tile's region of the canvas is never written. It retains uninitialized heap data that is delivered to the caller as decoded pixel values (4,096 bytes per Y/Cb/Cr plane = 12,288+ bytes total). Any application using libheif to decode grid-based HEIF/AVIF files with default settings is vulnerable: a crafted .heic or .avif file causes 4,096+ bytes of heap memory to appear as pixel values in the decoded image, and the calling application receives heif_error_Ok, so it has no indication the output contains heap garbage. In server-side image processing, an uploaded crafted HEIF decoded and re-encoded (e.g., as PNG/JPEG for thumbnails, CDN, social media) can leak cross-user data such as auth tokens, database results, and other users' image data. This issue has been fixed in version 1.22.0.
Title libheif: Uninitialized Heap Memory Information Leak via Failed Grid Tiles
Weaknesses CWE-200
CWE-908
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-908

    Use of Uninitialized Resource

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 20, 2026, 2:06 PM
Reserved
Mar 16, 2026, 5:35 PM
Status
Deferred
Published
May 19, 2026, 9:16 PM
Modified
Jul 24, 2026, 9:10 AM
Severity
Moderate
Public date
May 19, 2026, 7:49 PM