CVE-2026-32738
JSON

6.5medium

libheif has a Heap OOB Read/SEGV Crash via Zero samples_per_chunk

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.30% (higher than 24% 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 versions 1.21.2 and below, a crafted 792-byte HEIF sequence file with samples_per_chunk=0 in the stsc box causes an unsigned integer underflow in the Chunk constructor (m_last_sample = 0 + 0 - 1 = UINT32_MAX), mapping all samples to an empty chunk and resulting in a denial of service. When any sample is accessed, the library reads from index 0 of an empty std::vector, causing a guaranteed SEGV (null-page read). The file parses successfully without producing an error; the crash occurs on the first frame access. This issue has been fixed in version 1.22.0.

Affected

Product or packageVersionsReported by
strukturag libheif< 1.22.0CVE List
struktur libheifbefore 1.22.0NVD

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Classification

CWE-125CWE-476

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 versions 1.21.2 and below, a crafted 792-byte HEIF sequence file with samples_per_chunk=0 in the stsc box causes an unsigned integer underflow in the Chunk constructor (m_last_sample = 0 + 0 - 1 = UINT32_MAX), mapping all samples to an empty chunk and resulting in a denial of service. When any sample is accessed, the library reads from index 0 of an empty std::vector, causing a guaranteed SEGV (null-page read). The file parses successfully without producing an error; the crash occurs on the first frame access. This issue has been fixed in version 1.22.0.

NVD (es)

libheif es un decodificador y codificador de formato de archivo HEIF y AVIF. En las versiones 1.21.2 e inferiores, un archivo de secuencia HEIF de 792 bytes manipulado con samples_per_chunk=0 en la caja stsc causa un desbordamiento negativo de entero sin signo en el constructor de Chunk (m_last_sample = 0 + 0 - 1 = UINT32_MAX), mapeando todas las muestras a un fragmento vacío y resultando en una denegación de servicio. Cuando se accede a cualquier muestra, la biblioteca lee desde el índice 0 de un std::vector vacío, causando un SEGV garantizado (lectura de página nula). El archivo se analiza correctamente sin producir un error; el fallo ocurre en el primer acceso al fotograma. Este problema ha sido corregido en la versión 1.22.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-32738 changed 2026-05-19CVE Terms of Use
NVDCVE-2026-32738 changed 2026-07-24Public domain