Skip to content

Bundled libheif 1.20.1 / libde265 1.0.15: heap overflows decoding HEIC (fixed upstream) #57

Description

@dkgkdfg65

JarkViewer bundles libheif 1.20.1 and libde265 1.0.15 (via vcpkg libheif[hevc]). Both have heap out-of-bounds writes reachable when opening a crafted .heic/.heif (ImageDatabase::loadHeic -> heif_decode_image):

  1. libheif < 1.22.0 -- decode_mask_image (mask_image.cc) on the stride==width path copies the full item payload into a width*height plane; the only size check is a lower bound, so an oversized mski item overflows the heap. ASan on 1.20.1: heap-buffer-overflow WRITE in mask_image.cc. Fixed upstream by commit 123694271a (CVE-2026-32741).

  2. libde265 < 1.1.1 -- set_SliceHeaderIndex (image.h:740) writes past a MetaDataArray<CTB_info> allocation on a crafted HEVC (hvc1) primary item via read_coding_tree_unit. ASan on 1.0.15: heap-buffer-overflow WRITE. Fixed upstream in libde265 1.1.1 (CVE-2026-33165).

Both reproduce on standalone ASan builds of the bundled versions with small crafted HEIC inputs, and are clean on the fixed versions. Opening any HEIC dispatches to these bundled decoders, so a malicious image file alone triggers it.

Fix: bump bundled libheif to >= 1.22.0 and libde265 to >= 1.1.1 (e.g. update the vcpkg baseline).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions