libheif is an HEIF and AVIF file format decoder and encoder. Prior to version 1.21.0, a crafted HEIF that exercises the overlay image item path triggers a heap buffer over-read in HeifPixelImage::overlay(). The function computes a negative row length (likely from an unclipped overlay rectangle or invalid offsets), which then underflows when converted to size_t and is passed to memcpy, causing a very large read past the end of the source plane and a crash. Version 1.21.0 contains a patch. As a workaround, avoid decoding images using iovl overlay boxes.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68431.json",
"cna_assigner": "GitHub_M",
"cwe_ids": [
"CWE-125",
"CWE-190"
]
}[
{
"signature_type": "Function",
"id": "CVE-2025-68431-41f3b864",
"target": {
"file": "libheif/api/libheif/heif_decoding.cc",
"function": "fill_default_decoding_options"
},
"signature_version": "v1",
"digest": {
"function_hash": "34356497781205006473252364979556906119",
"length": 940.0
},
"deprecated": false,
"source": "https://github.com/strukturag/libheif/commit/81b09baa38ac8654d34d0f8b7780c44addfc7893"
},
{
"signature_type": "Function",
"id": "CVE-2025-68431-4ec9870c",
"target": {
"file": "libheif/api/libheif/heif_decoding.cc",
"function": "heif_decoding_options_copy"
},
"signature_version": "v1",
"digest": {
"function_hash": "329797198584329899104486683601108515964",
"length": 1374.0
},
"deprecated": false,
"source": "https://github.com/strukturag/libheif/commit/81b09baa38ac8654d34d0f8b7780c44addfc7893"
},
{
"signature_type": "Line",
"id": "CVE-2025-68431-8b16a428",
"target": {
"file": "libheif/api/libheif/heif_decoding.cc"
},
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"86989328228010646195824957620703865309",
"315748430350726531986735925707017146044",
"48195258588107620977743124844228928254",
"39329765749603303780335262745387807436",
"278674891859007306422493718580202199222",
"246737114233977316513938417832652467043",
"305193605705415212218217871446369761088",
"51058199956735957655386557920259163456",
"44218036590128212083565674600086656473",
"196590235662868324802423222985018305791",
"177174771090411233403604693192959750546",
"272346606380776608490083823624255834136",
"316203364162326920082443224420335411806",
"173998481382920159388264252056027936138",
"309796206102394975632185273807526561928",
"264961994815018702713207910196561053551",
"272640526741428161440284802322705573607",
"288262173295861768794265364273338310735",
"53705723303867008772075427526346244002"
]
},
"deprecated": false,
"source": "https://github.com/strukturag/libheif/commit/81b09baa38ac8654d34d0f8b7780c44addfc7893"
}
]
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-68431.json"