Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.3%top 73%

CVE-2026-32741: CWE-122: Heap-based Buffer Overflow in strukturag libheif

0
High
VulnerabilityCVE-2026-32741cvecve-2026-32741cwe-122
Published: 05/19/2026 (05/19/2026, 19:57:26 UTC)
Source: CVE Database V5
Vendor/Project: strukturag
Product: libheif

Description

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.

CVSS v3.1

Score 7.1high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H

Affected software

GitHub Actionsmore threats →ai
strukturag/libheif
pkg:github/strukturag/libheif
Affected versions
<1.22.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/15/2026, 08:56:27 UTC

Technical Analysis

CVE-2026-32741 is a heap-based buffer overflow vulnerability in the libheif library, specifically in the MaskImageCodec::decode_mask_image() function. When decoding a HEIF file with a mask image (mski), the function copies data using memcpy without an upper-bound check on the data length. The length is derived from the iloc extent in the file, which is attacker-controlled, while the destination buffer size is based on declared image dimensions. This mismatch can cause a heap overflow if the iloc extent exceeds the pixel buffer allocation. The vulnerable code path is triggered when the mskC property specifies bits_per_pixel = 8 and the ispe property declares an even width of at least 64. This vulnerability affects libheif versions prior to 1.22.0 and has been fixed in version 1.22.0.

Potential Impact

An attacker can craft a malicious HEIF file that triggers a heap-based buffer overflow during decoding, potentially leading to denial of service or other impacts related to memory corruption. The CVSS v3.1 score is 7.1 (high), indicating a network attack vector with low attack complexity, no privileges required, user interaction required, unchanged scope, no confidentiality impact, limited integrity impact, and high availability impact.

Mitigation Recommendations

This vulnerability is fixed in libheif version 1.22.0. Users should upgrade to version 1.22.0 or later to remediate this issue. Patch status is not explicitly stated in the vendor advisory excerpt, but the description confirms the fix in 1.22.0. No additional mitigations are indicated by the vendor advisory.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-03-13T15:02:00.628Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null
Vendor Advisory Urls
[{"url":"https://access.redhat.com/security/cve/CVE-2026-32741","vendor":"Red Hat"}]

Threat ID: 6a0cc91dba1db47362ec07c7

Added to database: 05/19/2026, 20:33:33 UTC

Last enriched: 07/15/2026, 08:56:27 UTC

Last updated: 07/31/2026, 19:22:58 UTC

Views: 70

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses