CVE-2026-62291
JSON

5.3medium

libheif: Heap out of bounds write in libheif uncompressed encoder when writing images with mismatched auxiliary alpha dimensions

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.22% (higher than 13% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

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

Product or packageVersionsReported by
strukturag libheif< 1.23.1CVE List

Classification

CWE-125CWE-787

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

libheif es un decodificador y codificador de formato de archivo HEIF y AVIF. En la versión 1.23.0 y anteriores, una secuencia de imagen manipulada con un plano primario de 2x2 y un plano alfa auxiliar de 256x256 puede causar corrupción de pila controlada por el atacante durante un flujo de trabajo normal de decodificación y recodificación. Track_Visual::decode_next_image_sample() llama a transfer_channel_from_image_as() sin verificar que las dimensiones del alfa auxiliar coincidan con el fotograma principal. La imagen inconsistente resultante llega a heif_track_decode_next_image() y luego a heif_context_encode_image(). En unc_encoder::encode(), unc_encoder_component_interleave::encode_tile() dimensiona su búfer con compute_tile_data_size_bytes() utilizando las dimensiones primarias, pero copia cada componente utilizando sus dimensiones de plano reales. El plano alfa sobredimensionado es, por lo tanto, copiado más allá de la asignación, causando una escritura fuera de límites; la discrepancia de tamaño inversa también puede producir una lectura fuera de límites. Este problema está corregido en la versión 1.23.1.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-62291 changed 2026-08-21CVE Terms of Use
NVDCVE-2026-62291 changed 2026-10-22Public domain