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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.22 | libheif | 1.19.8-r1 | ALPINE-CVE-2025-68431 |
| Alpine:v3.23 | libheif | 1.21.2-r0 | ALPINE-CVE-2025-68431 |
| Alpine:v3.24 | libheif | 1.21.2-r0 | ALPINE-CVE-2025-68431 |
| Debian:12 | libheif | no fix listed | DEBIAN-CVE-2025-68431 |
| Debian:13 | libheif | 1.19.8-1+deb13u1 | DEBIAN-CVE-2025-68431 |
| Debian:14 | libheif | 1.21.2-1 | DEBIAN-CVE-2025-68431 |
| Ubuntu:24.04:LTS | libheif | 1.17.6-1ubuntu4.2 | USN-7952-1 |
| Ubuntu:24.04:LTS | libheif | 1.17.6-1ubuntu4.2 | UBUNTU-CVE-2025-68431 |
| Ubuntu:25.10 | libheif | 1.20.2-1ubuntu0.1 | UBUNTU-CVE-2025-68431 |
| Ubuntu:25.10 | libheif | 1.20.2-1ubuntu0.1 | USN-7952-1 |
| Ubuntu:26.04:LTS | libheif | 1.21.2-1 | UBUNTU-CVE-2025-68431 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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