The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-68431

CVE-2025-68431: Struktur Libheif Buffer Overflow Vulnerability

CVE-2025-68431 is a heap buffer overflow in Struktur Libheif's HEIF decoder that triggers crashes through crafted overlay images. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: April 29, 2026

CVE-2025-68431 Overview

CVE-2025-68431 is an out-of-bounds read vulnerability in libheif, an open-source library for decoding and encoding HEIF and AVIF image file formats. The vulnerability exists in the HeifPixelImage::overlay() function, where a specially crafted HEIF file containing malicious overlay image items can trigger a heap buffer over-read condition. When processing overlay boxes (iovl), the function incorrectly computes a negative row length—likely stemming from an unclipped overlay rectangle or invalid offsets—which subsequently underflows when converted to size_t and is passed to memcpy. This results in an extremely large read operation past the end of the source memory plane, causing application crashes and potential information disclosure.

Critical Impact

This vulnerability allows remote attackers to crash applications using libheif by providing a maliciously crafted HEIF/AVIF image, leading to denial of service. The out-of-bounds read could also potentially leak sensitive memory contents.

Affected Products

  • struktur libheif versions prior to 1.21.0
  • Applications and services integrating libheif for HEIF/AVIF image processing
  • Image viewers, converters, and content management systems using the vulnerable library

Discovery Timeline

  • 2025-12-29 - CVE-2025-68431 published to NVD
  • 2026-02-25 - Last updated in NVD database

Technical Details for CVE-2025-68431

Vulnerability Analysis

The vulnerability resides in the overlay image composition logic within libheif's pixelimage.cc file. When processing HEIF images containing overlay image items (iovl boxes), the HeifPixelImage::overlay() function performs memory copy operations to composite multiple image layers. The flaw manifests when the function calculates the copy width for non-alpha pixel data transfers.

The original code computed the copy width as in_w - in_x0, which could produce a negative value when the input coordinates are improperly validated or when overlay rectangles extend beyond expected boundaries. In C/C++, when this negative signed integer is implicitly converted to an unsigned size_t type for the memcpy length parameter, integer underflow occurs. This transforms a small negative value into an astronomically large positive value, instructing memcpy to read far beyond the allocated source buffer boundaries.

Root Cause

The root cause is improper input validation and an incorrect copy width calculation in the overlay image processing code path. The vulnerability stems from the subtraction operation in_w - in_x0 which fails to account for cases where in_x0 could exceed in_w, or where the overlay rectangle parameters are maliciously crafted. The lack of boundary checks before the memcpy operation allows the integer underflow to propagate into a critical memory operation.

Attack Vector

An attacker can exploit this vulnerability by crafting a malicious HEIF or AVIF image file with specially constructed overlay image item (iovl) boxes containing invalid offsets or dimensions. When a victim application or service attempts to decode this malicious image using a vulnerable version of libheif, the following attack flow occurs:

  1. The malicious image is provided to the target via email attachment, web upload, messaging application, or any image processing workflow
  2. libheif parses the HEIF container and encounters the overlay image item
  3. The HeifPixelImage::overlay() function is invoked with attacker-controlled overlay parameters
  4. The copy width calculation produces a negative value that underflows to a massive unsigned value
  5. The subsequent memcpy reads past the source buffer, causing a crash or potential memory disclosure
text
       if (!has_alpha) {
         memcpy(out_p + out_x0 + (out_y0 + y - in_y0) * out_stride,
                in_p + in_x0 + y * in_stride,
-               in_w - in_x0);
+               in_w);
       }
       else {
         for (uint32_t x = in_x0; x < in_w; x++) {

Source: GitHub Commit

The patch corrects the copy width calculation by using in_w directly instead of the subtraction that could produce negative values.

Detection Methods for CVE-2025-68431

Indicators of Compromise

  • Unexpected application crashes or segmentation faults when processing HEIF/AVIF images
  • Increased crash reports in image processing services or applications
  • HEIF files containing unusual or malformed iovl (overlay) box structures
  • Memory access violation errors in logs related to libheif operations

Detection Strategies

  • Monitor for application crashes with stack traces pointing to HeifPixelImage::overlay() or libheif overlay processing functions
  • Implement file integrity checks and input validation for HEIF/AVIF images before processing
  • Deploy endpoint detection rules to identify exploitation attempts targeting image processing components
  • Use SentinelOne's behavioral AI to detect anomalous memory access patterns during image decoding operations

Monitoring Recommendations

  • Enable crash dump collection and analysis for applications using libheif to identify exploitation attempts
  • Implement logging for image processing operations, particularly for files containing overlay structures
  • Monitor system resource usage for abnormal memory read patterns that may indicate out-of-bounds access attempts
  • Configure alerts for repeated crash events in image handling services that could indicate active exploitation

How to Mitigate CVE-2025-68431

Immediate Actions Required

  • Upgrade libheif to version 1.21.0 or later immediately across all systems
  • Audit applications and services for libheif dependencies and prioritize patching
  • Implement input validation to reject or quarantine suspicious HEIF/AVIF files pending analysis
  • Consider temporarily disabling overlay image processing if patching cannot be immediately applied

Patch Information

The vulnerability has been addressed in libheif version 1.21.0. The fix corrects the copy width calculation in libheif/pixelimage.cc by changing the memcpy length from in_w - in_x0 to in_w, eliminating the integer underflow condition. Organizations should update to version 1.21.0 or later as soon as possible.

Patch details:

  • Fixed Version: 1.21.0
  • Commit: b8c12a7b70f46c9516711a988483bed377b78d46
  • Release: GitHub Release v1.21.0
  • Security Advisory: GHSA-j87x-4gmq-cqfq

Workarounds

  • Avoid decoding images that use iovl overlay boxes until the library can be updated
  • Implement pre-processing filters to strip or reject HEIF files containing overlay image items
  • Deploy sandboxed or isolated environments for processing untrusted image files
  • Use network-level controls to filter incoming HEIF/AVIF files from untrusted sources
bash
# Check current libheif version
pkg-config --modversion libheif

# Update libheif on Debian/Ubuntu systems
sudo apt update && sudo apt install libheif-dev

# Build from source for version 1.21.0
git clone https://github.com/strukturag/libheif.git
cd libheif
git checkout v1.21.0
mkdir build && cd build
cmake ..
make && sudo make install

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLibheif

  • SeverityHIGH

  • CVSS Score7.1

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-125
  • Technical References
  • GitHub Release v1.21.0
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-j87x-4gmq-cqfq
  • Latest CVEs
  • CVE-2026-43328: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43329: Linux Kernel Netfilter DoS Vulnerability

  • CVE-2026-43330: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-43331: Linux Kernel DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English