CVE-2025-68431: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2025-68431 is a heap buffer over-read vulnerability in libheif, an open-source HEIF and AVIF file format decoder and encoder. A crafted HEIF file that exercises the overlay image item (iovl) path triggers the flaw in HeifPixelImage::overlay(), leading to a crash and potential information disclosure. All versions up to and including 1.20.2 are affected; version 1.21.0 contains the fix. The vulnerability was disclosed on December 29, 2025, and carries a CVSS v3.1 base score of 7.1 (High) per NVD, or 6.5 (Medium) per the GitHub Security Advisory (GitHub Advisory, libheif v1.21.0).

Technical details

The root cause is an integer underflow (CWE-190) leading to an out-of-bounds read (CWE-125) in HeifPixelImage::overlay() (pixelimage.cc). When processing an iovl overlay box, the function computes the per-row copy width as in_w - in_x0; if in_x0 is larger than in_w due to an unclipped overlay rectangle or invalid offsets, the result is negative. This negative value is then implicitly cast to size_t, producing a very large unsigned integer that is passed directly to memcpy, causing a massive heap over-read past the end of the allocated source plane. The specific one-line fix in commit b8c12a7 changes the memcpy length argument from in_w - in_x0 to in_w, eliminating the erroneous subtraction (GitHub Advisory, Fix Commit). The vulnerability was discovered via libFuzzer with AddressSanitizer on Ubuntu 20.04 and credited to Aldo Ristori (GitHub Advisory).

Impact

Successful exploitation causes a crash of the application processing the malicious HEIF file, resulting in denial of service. Additionally, because the over-read copies adjacent heap memory into the destination image buffer, there is a potential for limited information disclosure — heap contents from the process memory could be exposed depending on the allocator layout. The vulnerability affects any application that uses libheif ≤ 1.20.2 to decode user-supplied HEIF images, including image viewers, media processing pipelines, and web services that handle HEIF/AVIF uploads (GitHub Advisory).

Exploitability

No active in-the-wild exploitation has been reported, and CVE-2025-68431 is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.032% (0.000320), indicating a low probability of near-term exploitation. Exploitation requires user interaction — a victim must open or process a specially crafted HEIF file — but no authentication or special privileges are needed. The GitHub Security Advisory references a fuzzer-generated reproducer, and the fix commit is public, which could aid in crafting a proof-of-concept (GitHub Advisory).

Exploitation steps

  1. Craft malicious HEIF file: Create a HEIF file containing an iovl (overlay image item) box with an overlay rectangle or offsets configured such that in_x0 > in_w, causing the computed copy width to be negative.
  2. Deliver the file to the target: Distribute the crafted HEIF via email attachment, web upload, shared storage, or any channel where the target application will process it (e.g., an image viewer, thumbnail generator, or media server).
  3. Trigger decoding: Cause the target application to decode the malicious HEIF file, invoking the call chain: heif_decode_image → HeifContext::decode_image → ImageItem_Overlay::decode_overlay_image → HeifPixelImage::overlay().
  4. Trigger the over-read: The negative row width underflows to a huge size_t value and is passed to memcpy, reading far past the end of the allocated heap plane.
  5. Achieve objective: The application crashes (denial of service), and depending on heap layout, adjacent heap memory may be copied into the destination image buffer, potentially leaking sensitive process data (GitHub Advisory, Fix Commit).

Indicators of compromise

  • File System: Presence of unexpected or externally sourced .heic, .heif, or .avif files with iovl overlay boxes in directories processed by libheif-based applications.
  • Logs: Application crash logs or core dumps referencing HeifPixelImage::overlay, pixelimage.cc:1509, or ImageItem_Overlay::decode_overlay_image; AddressSanitizer output showing heap-buffer-overflow READ of very large size (e.g., 4294967280 bytes).
  • Process: Unexpected termination (segfault/SIGABRT) of image processing services or viewers immediately after opening a HEIF file; abnormally large memcpy operations visible in system call traces (strace) from image-handling processes (GitHub Advisory).

Mitigation and workarounds

Upgrade libheif to version 1.21.0 or later, which contains the one-line patch fixing the erroneous memcpy length calculation in pixelimage.cc (libheif v1.21.0, Fix Commit). Downstream Linux distributions including Ubuntu (USN-7952-1) and SUSE have released updated packages. As a temporary workaround where upgrading is not immediately possible, avoid decoding HEIF images that use iovl overlay boxes, or disable processing of overlay image items in the application layer (GitHub Advisory, Ubuntu Advisory).

Community reactions

The vulnerability was discovered through fuzzing (libFuzzer + AddressSanitizer) and responsibly disclosed by Aldo Ristori. The libheif maintainers patched it promptly in the v1.21.0 release on December 29, 2025, the same day as disclosure. Multiple Linux distributions (Ubuntu, SUSE, openSUSE) subsequently issued security advisories and updated packages. No significant broader media coverage or notable researcher commentary beyond the standard advisory process has been observed (GitHub Advisory, libheif v1.21.0, Ubuntu Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

libheif

Affected

sid

libheif: 1.21.2-1

Fixed

trixie

libheif: 1.19.8-1+deb13u1

Fixed

Ubuntu

Fixed

bionic (esm-apps)

libheif: 1.1.0-2ubuntu0.1~esm2

Fixed

devel

libheif: 1.21.2-1

Fixed

focal (esm-apps)

libheif: 1.6.1-1ubuntu0.1~esm2

Fixed

jammy

libheif

Affected

jammy (esm-apps)

libheif: 1.12.0-2ubuntu0.1~esm2

Fixed

noble

libheif: 1.17.6-1ubuntu4.2

Fixed

questing

libheif: 1.20.2-1ubuntu0.1

Fixed

resolute

libheif: 1.21.2-1

Fixed

Alpine

Fixed

edge

libheif: 1.21.2-r0

Fixed

v3.22

libheif: 1.19.8-r1

Fixed

v3.23

libheif: 1.21.2-r0

Fixed

Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-112940HIGH7.1
  • Python logoPython
  • py3-filelock
NoYesOct 20, 2026
CVE-2026-112937MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112936MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112939MEDIUM4.7
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112941LOW3.3
  • Python logoPython
  • filelock
NoYesOct 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management