CVE-2026-41071: CWE-125: Out-of-bounds Read in strukturag libheif
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, a crafted HEIF sequence file where the saiz box declares more samples than actually exist in the track's chunk table causes a heap-buffer-overflow (out-of-bounds read) in the SampleAuxInfoReader constructor. The SampleAuxInfoReader constructor iterates over saiz->get_num_samples() samples but doesn't validate that this count is consistent with the number of chunks in the chunks vector. When saiz declares more samples than the chunks cover, the loop increments current_chunk past chunks.size(), causing an out-of-bounds read on the chunks vector. The vulnerability is triggered during file parsing (heif_context_read_from_file) without any additional user interaction. Any application using libheif to open untrusted HEIF files is affected. This issue has been fixed in version 1.22.0.
AI Analysis
Technical Summary
The vulnerability in libheif (CVE-2026-41071) arises from improper validation of sample counts in the saiz box of HEIF files. Specifically, the SampleAuxInfoReader constructor iterates over the number of samples declared by saiz without verifying that this number matches the actual number of chunks available. When saiz declares more samples than the chunks vector contains, the code reads out-of-bounds, causing a heap-buffer-overflow. This occurs during the heif_context_read_from_file function call when parsing a crafted HEIF file. Applications using libheif to process untrusted HEIF files are affected. The issue is resolved in libheif version 1.22.0.
Potential Impact
An attacker can cause a heap-buffer-overflow by supplying a specially crafted HEIF file, potentially leading to application crashes or other undefined behavior. The vulnerability requires no privileges and no user interaction beyond opening the malicious file. The CVSS 4.0 base score is 5.1 (medium severity), reflecting network attack vector, low complexity, no privileges required, and low impact on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability has been fixed in libheif version 1.22.0. Users and developers should upgrade to version 1.22.0 or later to remediate this issue. Since this is a library vulnerability, applications using libheif should update their dependencies accordingly. No vendor advisory content is provided to indicate alternative mitigations or that no action is required.
CVE-2026-41071: CWE-125: Out-of-bounds Read in strukturag libheif
Description
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, a crafted HEIF sequence file where the saiz box declares more samples than actually exist in the track's chunk table causes a heap-buffer-overflow (out-of-bounds read) in the SampleAuxInfoReader constructor. The SampleAuxInfoReader constructor iterates over saiz->get_num_samples() samples but doesn't validate that this count is consistent with the number of chunks in the chunks vector. When saiz declares more samples than the chunks cover, the loop increments current_chunk past chunks.size(), causing an out-of-bounds read on the chunks vector. The vulnerability is triggered during file parsing (heif_context_read_from_file) without any additional user interaction. Any application using libheif to open untrusted HEIF files is affected. This issue has been fixed in version 1.22.0.
CVSS v4.0
Score 5.1medium
Affected software
pkg:github/strukturag/libheifRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in libheif (CVE-2026-41071) arises from improper validation of sample counts in the saiz box of HEIF files. Specifically, the SampleAuxInfoReader constructor iterates over the number of samples declared by saiz without verifying that this number matches the actual number of chunks available. When saiz declares more samples than the chunks vector contains, the code reads out-of-bounds, causing a heap-buffer-overflow. This occurs during the heif_context_read_from_file function call when parsing a crafted HEIF file. Applications using libheif to process untrusted HEIF files are affected. The issue is resolved in libheif version 1.22.0.
Potential Impact
An attacker can cause a heap-buffer-overflow by supplying a specially crafted HEIF file, potentially leading to application crashes or other undefined behavior. The vulnerability requires no privileges and no user interaction beyond opening the malicious file. The CVSS 4.0 base score is 5.1 (medium severity), reflecting network attack vector, low complexity, no privileges required, and low impact on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability has been fixed in libheif version 1.22.0. Users and developers should upgrade to version 1.22.0 or later to remediate this issue. Since this is a library vulnerability, applications using libheif should update their dependencies accordingly. No vendor advisory content is provided to indicate alternative mitigations or that no action is required.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-16T16:43:03.174Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a10cacbe1370fbb48572382
Added to database: 05/22/2026, 21:29:47 UTC
Last enriched: 05/30/2026, 20:20:29 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 139
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.