Cloudanix VulnDB

CVE-2026-62291

Medium · 5.3

CVSS

5.3

EPSS

0.2%

Published

Aug 18, 2026

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A flaw in image-handling software can let specially crafted image files corrupt memory when the program tries to read and then save them again, which could crash the program or let an attacker take control.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Data Tampering
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Heap corruption via out-of-bounds write (and possible read) in libheif during normal decode/re-encode when an auxiliary alpha plane has different dimensions than the primary plane; Track_Visual::decode_next_image_sample calls transfer_channel_from_image_as without dimension checks, and unc_encoder_component_interleave::encode_tile sizes buffers from primary dimensions but copies using actual plane sizes.

Why it matters to the business

Applications that decode or re-encode HEIF/AVIF image sequences may crash, corrupt data, or allow attacker-controlled memory writes, disrupting media workflows, image pipelines, or content-processing services.

How an attack unfolds

An attacker supplies a crafted HEIF/AVIF sequence whose 2x2 primary plane and 256x256 auxiliary alpha plane reach heif_track_decode_next_image and then heif_context_encode_image; the size mismatch in unc_encoder causes the oversized alpha data to be copied past the allocated buffer during encode_tile, achieving memory corruption.

How to fix it

Upgrade libheif to version 1.23.1 or later; rebuild and redeploy any dependent applications or containers that statically or dynamically link the vulnerable library.

How to confirm the fix worked

Confirm installed libheif version is 1.23.1 or newer; run regression tests using sample files that contain mismatched primary/auxiliary plane dimensions; monitor for absence of crashes or sanitizer reports on those inputs.

Typical attack path

  1. Craft HEIF/AVIF image sequence with mismatched primary and auxiliary alpha dimensions
  2. Deliver file to target application or service that performs decode-then-encode
  3. Trigger normal image processing path reaching Track_Visual::decode_next_image_sample and unc_encoder
  4. Induce out-of-bounds write during component interleave copy

How to detect it

Search application and system logs for crashes or segmentation faults originating from libheif decode/encode paths; inspect stack traces containing transfer_channel_from_image_as, heif_track_decode_next_image, or unc_encoder_component_interleave; monitor for unexpected process terminations when processing HEIF/AVIF files.

What your security team should do

  • Immediately inventory all systems and containers for libheif versions prior to 1.23.1
  • Prioritize patching in any media-processing, thumbnail-generation, or content-ingestion pipelines
  • Add libheif version checks to dependency scanners and CI gates
  • Temporarily disable re-encoding workflows on untrusted image input until patched

The record

libheif is a HEIF and AVIF file format decoder and encoder. In 1.23.0 and earlier, a crafted image sequence with a 2x2 primary plane and a 256x256 auxiliary alpha plane can cause attacker-controlled heap corruption during a normal decode and re-encode workflow. Track_Visual::decode_next_image_sample() calls transfer_channel_from_image_as() without checking that the auxiliary alpha dimensions match the main frame. The resulting inconsistent image reaches heif_track_decode_next_image() and then heif_context_encode_image(). In unc_encoder::encode(), unc_encoder_component_interleave::encode_tile() sizes its buffer with compute_tile_data_size_bytes() using the primary dimensions but copies each component using its actual plane dimensions. The oversized alpha plane is therefore copied beyond the allocation, causing an out-of-bounds write; the inverse size mismatch can also produce an out-of-bounds read. This issue is fixed in version 1.23.1.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities