Skip to main content

libheif CVE-2026-32741

| EUVDEUVD-2026-30982 HIGH
Heap-based Buffer Overflow (CWE-122)
2026-05-19 GitHub_M
7.1
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft HEIF with oversized mski iloc extent
  2. Delivery
    Deliver via email, web, or messaging
  3. Exploit
    Victim app auto-decodes or previews file
  4. Execution
    MaskImageCodec::decode_mask_image() memcpys attacker-sized data
  5. Persist
    Heap buffer overflow corrupts adjacent chunks
  6. Impact
    Process crash or potential code execution in host application

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the victim to process (open, preview, thumbnail, or convert) an attacker-supplied HEIF file using libheif ≤ 1.21.2; the file must contain a mask image item whose mskC property sets bits_per_pixel=8 and whose ispe property declares an even width ≥ 64 so the stride==width fast path is taken, with an iloc extent size larger than the derived pixel buffer. Per the advisory, no changes to libheif's default security limits and no external codec plugins are needed, so a default-configured deployment is vulnerable. Limiting factors per the CVSS vector (UI:R): user or automated interaction with the file is required - purely passive network presence does not trigger the bug - and no authentication to libheif itself is involved since it is a library, so risk scales with how aggressively the host application auto-decodes untrusted imagery.

Impact

The CVSS 3.1 vector AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H (7.1, High) captures the realistic exposure: the file can be delivered remotely, attack complexity is low, no privileges are required, but user interaction (opening or processing the file) is needed, and the documented impact is high availability loss with limited integrity impact (no confidentiality). Heap corruption of this shape is plausibly upgradable to code execution depending on the host allocator and surrounding objects, but the CVSS authors conservatively rated C:N, suggesting RCE is not yet demonstrated. No EPSS score, no CISA KEV listing, and no POC reference were supplied - exploitation status is therefore 'no public exploit identified at time of analysis'. The realistic priority is moderate-to-high for any product that auto-renders untrusted HEIF/AVIF (mail clients, chat apps, thumbnailers, browsers), and lower for batch tools that only touch trusted imagery.

Exploit ScenarioDerived

An attacker emails or hosts a crafted .heic file whose mski box uses mskC.bits_per_pixel=8 and an ispe width of 64+ (even), with an iloc extent declaring a payload far larger than the computed pixel buffer. When a victim opens the image, or simply when an automated thumbnailer or mail client decodes it, MaskImageCodec::decode_mask_image() memcpys the oversized extent into the heap allocation, corrupting adjacent chunks and at minimum crashing the host process; with allocator grooming, the corruption may be steered toward higher-impact outcomes.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 19, 2026

Heap buffer overflow in libheif versions 1.21.2 and below allows remote attackers to corrupt memory via a maliciously crafted HEIF file containing a mask image (mski) box. The flaw resides in MaskImageCodec::decode_mask_image(), where an attacker-controlled iloc extent length is memcpy'd into an undersized pixel buffer with no upper-bound validation, yielding heap corruption when a user opens the file. No public exploit identified at time of analysis, but the vulnerability is straightforward to trigger because the vulnerable branch is reachable under default library security limits.

RemediationAI

Vendor-released patch: upgrade libheif to 1.22.0 or later from https://github.com/strukturag/libheif/releases/tag/v1.22.0, per advisory GHSA-j3w5-7whq-p37q. Distribution packagers and applications that bundle libheif (image viewers, browsers, GIMP/ImageMagick stacks, thumbnailers, mail/chat clients) must rebuild against the patched library. If immediate upgrade is not possible, compensating controls include disabling automatic HEIF/AVIF thumbnail generation and preview in file managers and mail clients, stripping or sandboxing HEIF processing in upload pipelines (e.g., run conversion under seccomp/AppArmor or in a memory-safe wrapper), and refusing files that declare a mski box until patched; the trade-off is loss of HEIF preview/upload functionality and potential breakage of workflows that legitimately use mask images.

Affected VersionsENISA

libheif < 1.22.0

Affected Packages

euvd libheif fix: 1.22.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

libheif (CPE cpe:2.3:a:strukturag:libheif) is the de-facto open-source decoder/encoder for HEIF and AVIF imagery, embedded across image viewers, browsers, photo pipelines, and ImageMagick/GDK-Pixbuf loaders. CWE-122 (heap-based buffer overflow) here arises because MaskImageCodec::decode_mask_image() trusts the iloc extent size from the file when computing the memcpy length, while the destination heap allocation is sized from the ispe (image spatial extent) dimensions and mskC bits_per_pixel. The single-memcpy fast path is taken when mskC.bits_per_pixel == 8 and ispe declares an even width ≥ 64 (so stride equals width), giving an attacker direct control over how many bytes are written past the allocation boundary.

Know when Libheif gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.1 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H
SUSE HIGH
Red Hat 7.1 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High

Lifecycle Timeline

1
Patch available
May 19, 2026 - 21:02 EUVD

DescriptionCVE.org

libheif is a HEIF and AVIF file format decoder and encoder. Versions 1.21.2 and below contain a heap buffer overflow in MaskImageCodec::decode_mask_image(). When decoding a HEIF file containing a mask image (mski), the function copies the full iloc extent data into a pixel buffer using memcpy(dst, data.data(), data.size()). The copy length data.size() is determined by the iloc extent in the file (attacker-controlled), while the destination buffer is sized based on the declared image dimensions. Because no upper-bound check exists on the data length, a crafted file whose iloc extent exceeds the pixel buffer allocation overflows the heap. The vulnerable single-memcpy branch is reached when the mskC property specifies bits_per_pixel = 8 and the ispe property declares an even width ≥ 64 (so that stride == width), with no changes to default security limits or external codec plugins required. This issue has been fixed in version 1.22.0.

Executive ViewAI

Why It Matters

libheif (versions 1.21.2 and below) contains a heap buffer overflow that allows attackers to corrupt system memory through maliciously crafted HEIF image files. Organizations whose users open HEIF files-including photographers, designers, and Apple device users-face potential data loss or system compromise. Because no vendor patch is currently available, interim mitigations are required immediately.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable HEIF processing in applications and endpoints where not business-critical; (2) Sandbox or isolate image processing services that must handle HEIF files; (3) Restrict HEIF file uploads to pre-vetted internal sources and implement file-type validation to block .heif/.heic files; (4) Deploy additional monitoring for process crashes and memory corruption events in image handling; (5) Advise end users to avoid opening HEIF files from untrusted sources pending vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 90% exploitable
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.

CVE-2023-49464 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the function UncompressedImageCodec::get_luma_bit

CVE-2023-49463 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the function find_exif_tag at /libheif/exif.cc. R

CVE-2023-49462 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the component /libheif/exif.cc. Rated high severi

CVE-2023-49460 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the function UncompressedImageCodec::decode_uncom

CVE-2019-11471 HIGH POC
8.8 Apr 23

libheif 1.4.0 has a use-after-free in heif::HeifContext::Image::set_alpha_channel in heif_context.h because heif_context

CVE-2024-41311 HIGH POC
8.1 Oct 15

In Libheif 1.17.6, insufficient checks in ImageOverlay::parse() decoding a heif file containing an overlay image with fo

CVE-2024-25269 HIGH POC
7.5 Mar 05

libheif <= 1.17.6 contains a memory leak in the function JpegEncoder::Encode. Rated high severity (CVSS 7.5), this vulne

CVE-2025-68431 HIGH POC
7.1

Out-of-bounds read in libheif's HEIF/HEIC overlay processing can disclose limited memory contents and crash affected app

CVE-2023-29659 MEDIUM POC
6.5 May 05

A Segmentation fault caused by a floating point exception exists in libheif 1.15.1 using crafted heif images via the hei

CVE-2025-29482 MEDIUM POC
6.2 Apr 07

Buffer Overflow vulnerability in libheif 1.19.7 allows a local attacker to execute arbitrary code via the SAO (Sample Ad

CVE-2026-84383 CRITICAL
9.8 Sep 04

Heap-based buffer overflow in libheif before 1.23.2 allows remote attackers to corrupt memory and potentially achieve co

CVE-2026-32740 HIGH
8.8 May 19

Heap buffer overflow write in libheif (versions ≤ 1.21.2) lets a crafted HEIF/AVIF file write 64 bytes of attacker-contr

Vendor StatusVendor

SUSE

Severity: High
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Module for Desktop Applications 15 SP7 Fixed
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
SUSE Linux Enterprise Server 15 SP7 Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy