CVE-2025-62821
Description
Microsoft HEIF Image Extensions 1.2.22.0 has an out-of-bounds read because CHEIFItemInfoEntry_GetDataSize can return success while leaving the reported data size as 0. This causes a caller to make a 1-byte allocation. Later, CopyPixels computes copy_size = stride * abs(roi_height) but does not check the source buffer length before a memmove call.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1- Range: =1.2.22.0
Patches
Vulnerability mechanics
Root cause
"`CHEIFItemInfoEntry_GetDataSize` returns success with a size of 0, causing an under‑allocation (1‑byte buffer) that is later read far beyond its bounds in `CopyPixels` without a source‑length check."
Attack vector
An attacker crafts a malicious HEIF file that triggers a specific failure branch in `CHEIFItemInfoEntry_GetDataSize`, causing it to return success while leaving the reported data size at 0 [ref_id=1]. The `CHEIFStreamReader_ReadItemData` function then calls `MFCreateMemoryBuffer(0)`, which allocates only a 1‑byte source buffer [ref_id=1]. Later, the `CopyPixels` path computes a large `copy_size = stride * abs(roi_height)` and passes it to `memmove(dst, src, copy_size)` without verifying that the source buffer holds at least that many bytes, resulting in an out‑of‑bounds read and access violation [CWE-125] [ref_id=1]. Opening or previewing the crafted HEIF file in any application that uses Windows Imaging Component (WIC), such as Microsoft Photos, triggers the crash, leading to denial of service [ref_id=1]. No authentication or special network position is required beyond delivering the file to the target (e.g., via email, download, or USB).
What the fix does
The researcher suggests validating in the `CopyPixels` path that the source buffer has at least `stride * abs(roi_height)` bytes before performing the `memmove` [ref_id=1]. If the source is too small, the function should fail with `WINCODEC_ERR_INSUFFICIENTBUFFER` (or an equivalent error) instead of reading past the buffer boundary [ref_id=1]. The patch is not published in the repository; only the advisory and suggested fix are provided [ref_id=1].
Preconditions
- configThe target must have the Microsoft HEIF Image Extensions (version 1.2.22.0) installed and enabled
- inputThe crafted HEIF file must be opened or previewed in an application that routes through WIC (e.g., Microsoft Photos)
- networkAttacker must deliver the malicious HEIF file to the victim via email, download, or physical media
Reproduction
Download the PoC HEIF file from the repository and open it with Microsoft Photos (or any WIC‑based image viewer). The application crashes with an access violation when the codec attempts to read past the 1‑byte source buffer during `memmove`.
Generated on Jun 20, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
News mentions
0No linked articles in our index yet.