{"id":"CVE-2026-32741","aliases":["CVE-2026-32741"],"related":[],"kind":"vulnerability","state":"published","title":"libheif has a heap buffer overflow in decode_mask_image()","summary":"libheif is a HEIF and AVIF file format decoder and encoder. Versions 1.21.2 and below contain a heap buffer overflow in MaskImageCodec::decode_mask_image(). When decoding a HEIF file containing a mask image (mski), the function copies the full iloc extent data into a pixel buffer using memcpy(dst, data.data(), data.size()). The copy length data.size() is determined by the iloc extent in the file (attacker-controlled), while the destination buffer is sized based on the declared image dimensions. Because no upper-bound check exists on the data length, a crafted file whose iloc extent exceeds the pixel buffer allocation overflows the heap. The vulnerable single-memcpy branch is reached when the mskC property specifies bits_per_pixel = 8 and the ispe property declares an even width ≥ 64 (so that stride == width), with no changes to default security limits or external codec plugins required. This issue has been fixed in version 1.22.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"libheif is a HEIF and AVIF file format decoder and encoder. Versions 1.21.2 and below contain a heap buffer overflow in MaskImageCodec::decode_mask_image(). When decoding a HEIF file containing a mask image (mski), the function copies the full iloc extent data into a pixel buffer using memcpy(dst, data.data(), data.size()). The copy length data.size() is determined by the iloc extent in the file (attacker-controlled), while the destination buffer is sized based on the declared image dimensions. Because no upper-bound check exists on the data length, a crafted file whose iloc extent exceeds the pixel buffer allocation overflows the heap. The vulnerable single-memcpy branch is reached when the mskC property specifies bits_per_pixel = 8 and the ispe property declares an even width ≥ 64 (so that stride == width), with no changes to default security limits or external codec plugins required. This issue has been fixed in version 1.22.0.","source":"cvelist"},{"lang":"es","text":"libheif es un decodificador y codificador de formato de archivo HEIF y AVIF. Las versiones 1.21.2 e inferiores contienen un desbordamiento de búfer de montón en MaskImageCodec::decode_mask_image(). Al decodificar un archivo HEIF que contiene una imagen de máscara (mski), la función copia los datos completos de la extensión iloc en un búfer de píxeles usando memcpy(dst, data.data(), data.size()). La longitud de copia data.size() está determinada por la extensión iloc en el archivo (controlada por el atacante), mientras que el búfer de destino se dimensiona en función de las dimensiones de imagen declaradas. Debido a que no existe una comprobación de límite superior en la longitud de los datos, un archivo manipulado cuya extensión iloc excede la asignación del búfer de píxeles desborda el montón. Se alcanza la rama vulnerable de single-memcpy cuando la propiedad mskC especifica bits_per_pixel = 8 y la propiedad ispe declara un ancho par ? 64 (de modo que stride == width), sin necesidad de cambios en los límites de seguridad predeterminados o plugins de códec externos. Este problema ha sido solucionado en la versión 1.22.0.","source":"nvd"}],"published":"2026-05-19T19:57:26.525Z","modified":"2026-07-24T09:10:00.153Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H","score":7.1,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H","score":7.1,"rating":"HIGH"}],"cwes":["CWE-120","CWE-122"],"affected":[{"ranges":[{"version":"< 1.22.0","status":"affected"}],"vendor":"strukturag","product":"libheif","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","package":"glycin-loaders","cpe":"cpe:/o:redhat:enterprise_linux:10","source":"cvelist"}],"references":[{"url":"https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q","tags":["exploit","x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/strukturag/libheif/releases/tag/v1.22.0","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-32741","tags":["vdb-entry","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2480002","tags":["issue-tracking","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32741.json","tags":["x-sadp-csaf-vex"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-20T14:37:31.409Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-32741","url":"https://www.cve.org/CVERecord?id=CVE-2026-32741","licence":"CVE Terms of Use","modified":"2026-07-15T01:07:42.833Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-32741","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32741","licence":"Public domain","modified":"2026-07-24T09:10:00.153Z"}],"updatedAt":"2026-11-25T22:59:21.996Z","epss":{"score":0.0046,"percentile":0.41589,"date":"2026-12-01T12:00:22.000Z"}}