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


- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 29 Dec 2025
- **Updated:** 30 Dec 2025
- **Also known as:** ALPINE-CVE-2025-68431, DEBIAN-CVE-2025-68431, ECHO-d777-8afd-de52, GHSA-j87x-4gmq-cqfq, JLSEC-2026-156, ROOT-OS-DEBIAN-11-CVE-2025-68431, ROOT-OS-DEBIAN-12-CVE-2025-68431, SUSE-SU-2026:0087-1, SUSE-SU-2026:0377-1, SUSE-SU-2026:20121-1, UBUNTU-CVE-2025-68431, openSUSE-SU-2026:10019-1, openSUSE-SU-2026:20076-1

## What is CVE-2025-68431?

CVE-2025-68431 is a medium-severity vulnerability in strukturag libheif, published on 29 Dec 2025. 

### 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.

Weakness: CWE-190 (Integer Overflow or Wraparound), CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2025-68431?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libheif` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP7 | All versions | 1.19.5-150700.3.3.1 |
| `libheif` | SUSE:Linux Enterprise Module for Package Hub 15 SP7 | All versions | 1.19.5-150700.3.3.1 |
| `libheif` | SUSE:Linux Enterprise Server 16.0 | All versions | 1.19.7-160000.3.1 |
| `libheif` | SUSE:Linux Enterprise Server for SAP applications 16.0 | All versions | 1.19.7-160000.3.1 |
| `libheif` | openSUSE:Leap 15.6 | All versions | 1.12.0-150400.3.17.1 |
| `libheif` | openSUSE:Leap 16.0 | All versions | 1.19.7-160000.3.1 |
| `libheif` | openSUSE:Tumbleweed | All versions | 1.21.1-1.1 |

Products: Struktur Libheif.

## How do I fix CVE-2025-68431?

Upgrade to a fixed version.

## Is CVE-2025-68431 being exploited?

There is no known exploitation of CVE-2025-68431 in the wild and no public exploit code.

## Other vulnerabilities in strukturag libheif

- [CVE-2026-32740](https://insights.sbomify.com/CVE-2026-32740/): libheif: Heap-Buffer-Overflow Write in Grid Tile Chroma Compositing (high 8.8)
- [CVE-2023-49460](https://insights.sbomify.com/CVE-2023-49460/): Null dereference in n/a (high 8.8)
- [CVE-2023-49462](https://insights.sbomify.com/CVE-2023-49462/): Null dereference in n/a (high 8.8)
- [CVE-2023-49463](https://insights.sbomify.com/CVE-2023-49463/): Null dereference in n/a (high 8.8)
- [CVE-2023-49464](https://insights.sbomify.com/CVE-2023-49464/): Null dereference in n/a (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68431 and fix it if it is affected.

What it is: CVE-2025-68431 is a medium-severity vulnerability in strukturag libheif, published on 29 Dec 2025. 
Exploitation: There is no known exploitation of CVE-2025-68431 in the wild and no public exploit code.

Affected product: strukturag libheif. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-68431/ (Markdown: https://insights.sbomify.com/CVE-2025-68431/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-68431
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-68431
- OSV: https://osv.dev/vulnerability/CVE-2025-68431

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-68431/
Summaries are generated and may contain mistakes; the official description above is the record.
