Heap-based Buffer OverflowWeakness · CWE-122

CVE-2026-32741

HIGH · 7.1 CVSS v3.1 Published 2026-05-19
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
78/100
Remediation priority · High
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Heap buffer overflow in libheif's MaskImageCodec::decode_mask_image() function when processing HEIF files with mask images (mski). The function uses memcpy with length from attacker-controlled iloc extent data to copy into a destination buffer sized only by declared image dimensions, with no bounds checking. The vulnerable path requires mskC with bits_per_pixel=8 and ispe with even width ≥64.

MitigationUpgrade libheif to version 1.22.0 or later, which contains the bounds check fix. Audit all applications and services using libheif to ensure they incorporate the patched version.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
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

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify libheif version
    Run 'heif --version' or check the library file version (e.g., 'pkg-config --modversion libheif' or 'dpkg -l | grep libheif' on Linux, or inspect the DLL/so file properties on Windows)
    Affected if Version is 1.21.2 or below, or version cannot be determined and is likely older than 1.22.0
  2. Determine if HEIF image processing is active
    Inspect any applications or services that use libheif to process HEIF/HEIC image files; check process lists or file access logs for recent .heic or .heif file operations
    Affected if HEIF image files are being decoded using libheif
  3. Verify mask image handling is occurring
    Analyze HEIF files in use with tools like 'heif-info' or by inspecting the file structure for mskC (mask) boxes; check if any code path decodes mask images within HEIF containers
    Affected if HEIF files containing embedded mask images (mskC) are being processed
  4. Inspect image dimensions in HEIF files
    Use a HEIF parsing tool or binary analysis to examine the ispe (image spatial extents) property within processed files; specifically check for declared width values that are even and ≥ 64 pixels
    Affected if Processed HEIF files have ispe width declared as an even number of 64 or greater while containing mask data with bits_per_pixel=8
  5. Check for mask bits_per_pixel setting
    Examine the mskC (mask) properties in HEIF files to determine bits_per_pixel value; this typically requires parsing the HEIF container structure
    Affected if mskC mask data has bits_per_pixel=8 and the image meets the width criteria from step 4

Affected if running libheif 1.21.2 or below AND processing HEIF files with mask images where the declared image width is an even number ≥ 64 pixels and mask has 8 bits per pixel.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade libheif to version 1.22.0 or later, which contains the bounds check fix. Audit all applications and services using libheif to ensure they incorporate the patched version.

Recommended fix High confidence

libheif version 1.22.0

  1. Identify the current libheif version installed in your system (e.g., run 'heif --version' or check your package manager)
  2. Upgrade libheif to version 1.22.0 or later. For source compilation, download the release from https://github.com/strukturag/libheif/releases/tag/v1.22.0 and rebuild. For package managers, update to the latest available package that includes version 1.22.0 or higher
  3. Verify the installed version is 1.22.0 or later using 'heif --version' or equivalent
  4. If you redistribute libheif, update your dependencies to require libheif >= 1.22.0

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation6.0 h
  • Implementation4.0 h
  • Testing8.0 h
  • Review / QA4.0 h
22.0 hours of engineering $3,840
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $6,144.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-32741 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-32741 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data