libheif is a HEIF and AVIF file format decoder and encoder. In 1.23.0 and earlier, a crafted image sequence with a 2x2 primary plane and a 256x256 auxiliary alpha plane can cause attacker-controlled heap corruption during a normal decode and re-encode workflow. Track_Visual::decode_next_image_sample() calls transfer_channel_from_image_as() without checking that the auxiliary alpha dimensions match the main frame. The resulting inconsistent image reaches heif_track_decode_next_image() and then heif_context_encode_image(). In unc_encoder::encode(), unc_encoder_component_interleave::encode_tile() sizes its buffer with compute_tile_data_size_bytes() using the primary dimensions but copies each component using its actual plane dimensions. The oversized alpha plane is therefore copied beyond the allocation, causing an out-of-bounds write; the inverse size mismatch can also produce an out-of-bounds read. This issue is fixed in version 1.23.1.
{
"cna_assigner": "GitHub_M",
"cwe_ids": [
"CWE-125",
"CWE-787"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/62xxx/CVE-2026-62291.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-62291.json"
[
{
"deprecated": false,
"digest": {
"function_hash": "196621563875232672326975017639418466314",
"length": 1991
},
"id": "CVE-2026-62291-2123b5fb",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/strukturag/libheif/commit/ac5521ad50399885de96bb6a0733a5d2442740f9",
"target": {
"file": "libheif/codecs/uncompressed/unc_encoder.cc",
"function": "unc_encoder::encode"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"293395063892101953258080744798451347796",
"200297442726296910814761521898004405792",
"258223894114559044881824964583410561485"
],
"threshold": 0.9
},
"id": "CVE-2026-62291-3833fea8",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/strukturag/libheif/commit/ac5521ad50399885de96bb6a0733a5d2442740f9",
"target": {
"file": "libheif/codecs/uncompressed/unc_encoder.h"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"34033797850869162351072586973842857089",
"79161378973817674341721236884539057353",
"184479302279232768650820080103922531901",
"317675565127953322536838477041370862769",
"23374754115428411822086913696571082841",
"254957459140435460146804778449576390210"
],
"threshold": 0.9
},
"id": "CVE-2026-62291-743d4de7",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/strukturag/libheif/commit/ac5521ad50399885de96bb6a0733a5d2442740f9",
"target": {
"file": "libheif/codecs/uncompressed/unc_encoder.cc"
}
}
]
"2026-09-11T08:36:37Z"