Vulnerability · Published Dec 29, 2025 · Assigned by GitHub_M

CVE-2025-68431libheif has Potential Heap Buffer Over-Read

Medium 6.5

In plain English

A medium-severity out-of-bounds read in libheif from strukturag. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 37% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)6.5Medium
Exploit odds (30 days)0.4%top 62.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

libheif is an HEIF and AVIF file format decoder and encoder. Prior to version 1.21.0, a crafted HEIF that exercises the overlay image item path triggers a heap buffer over-read in `HeifPixelImage::overlay()`. The function computes a negative row length (likely from an unclipped overlay rectangle or invalid offsets), which then underflows when converted to `size_t` and is passed to `memcpy`, causing a very large read past the end of the source plane and a crash. Version 1.21.0 contains a patch. As a workaround, avoid decoding images using `iovl` overlay boxes.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.22libheif1.19.8-r1ALPINE-CVE-2025-68431
Alpine:v3.23libheif1.21.2-r0ALPINE-CVE-2025-68431
Alpine:v3.24libheif1.21.2-r0ALPINE-CVE-2025-68431
Debian:12libheifno fix listedDEBIAN-CVE-2025-68431
Debian:13libheif1.19.8-1+deb13u1DEBIAN-CVE-2025-68431
Debian:14libheif1.21.2-1DEBIAN-CVE-2025-68431
Ubuntu:24.04:LTSlibheif1.17.6-1ubuntu4.2USN-7952-1
Ubuntu:24.04:LTSlibheif1.17.6-1ubuntu4.2UBUNTU-CVE-2025-68431
Ubuntu:25.10libheif1.20.2-1ubuntu0.1UBUNTU-CVE-2025-68431
Ubuntu:25.10libheif1.20.2-1ubuntu0.1USN-7952-1
Ubuntu:26.04:LTSlibheif1.21.2-1UBUNTU-CVE-2025-68431

Affected products (as reported)

VendorProductVersions
strukturag libheif < 1.21.0

Weakness: CWE-125, CWE-190 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

References