CVE-2026-32738: 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 below, a crafted 792-byte HEIF sequence file with samples_per_chunk=0 in the stsc box causes an unsigned integer underflow in the Chunk constructor (m_last_sample = 0 + 0 - 1 = UINT32_MAX), mapping all samples to an empty chunk and resulting in a denial of service. When any sample is accessed, the library reads from index 0 of an empty std::vector, causing a guaranteed SEGV (null-page read). The file parses successfully without producing an error; the crash occurs on the first frame access. This issue has been fixed in version 1.22.0.
AI Analysis
Technical Summary
The vulnerability in libheif (<=1.21.2) arises from an unsigned integer underflow in the Chunk constructor when processing a specially crafted HEIF file with samples_per_chunk=0 in the stsc box. This underflow sets m_last_sample to UINT32_MAX, mapping all samples to an empty chunk. Subsequent access to any sample causes an out-of-bounds read from an empty std::vector, resulting in a guaranteed segmentation fault (null-page read) and denial of service. The malformed file parses successfully without error, but the crash occurs upon first frame access. The issue is resolved in libheif version 1.22.0.
Potential Impact
This vulnerability causes a denial of service via application crash when processing a maliciously crafted HEIF file. There is no impact on confidentiality or integrity. The crash is triggered on first frame access after successful parsing, leading to a guaranteed segmentation fault. No known exploits are reported in the wild.
Mitigation Recommendations
Upgrade libheif to version 1.22.0 or later, where this vulnerability is fixed. Versions prior to 1.22.0 are vulnerable. No other mitigation or workaround is documented. Patch status is confirmed fixed in the vendor's version 1.22.0 release.
CVE-2026-32738: 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 below, a crafted 792-byte HEIF sequence file with samples_per_chunk=0 in the stsc box causes an unsigned integer underflow in the Chunk constructor (m_last_sample = 0 + 0 - 1 = UINT32_MAX), mapping all samples to an empty chunk and resulting in a denial of service. When any sample is accessed, the library reads from index 0 of an empty std::vector, causing a guaranteed SEGV (null-page read). The file parses successfully without producing an error; the crash occurs on the first frame access. This issue has been fixed in version 1.22.0.
CVSS v3.1
Score 6.5medium
Affected software
pkg:github/strukturag/libheifRun 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
Technical Analysis
The vulnerability in libheif (<=1.21.2) arises from an unsigned integer underflow in the Chunk constructor when processing a specially crafted HEIF file with samples_per_chunk=0 in the stsc box. This underflow sets m_last_sample to UINT32_MAX, mapping all samples to an empty chunk. Subsequent access to any sample causes an out-of-bounds read from an empty std::vector, resulting in a guaranteed segmentation fault (null-page read) and denial of service. The malformed file parses successfully without error, but the crash occurs upon first frame access. The issue is resolved in libheif version 1.22.0.
Potential Impact
This vulnerability causes a denial of service via application crash when processing a maliciously crafted HEIF file. There is no impact on confidentiality or integrity. The crash is triggered on first frame access after successful parsing, leading to a guaranteed segmentation fault. No known exploits are reported in the wild.
Mitigation Recommendations
Upgrade libheif to version 1.22.0 or later, where this vulnerability is fixed. Versions prior to 1.22.0 are vulnerable. No other mitigation or workaround is documented. Patch status is confirmed fixed in the vendor's version 1.22.0 release.
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
Threat ID: 6a0cb784ba1db47362cbb38b
Added to database: 05/19/2026, 19:18:28 UTC
Last enriched: 05/19/2026, 19:33:55 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 80
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.
External Links
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.