{"id":"CVE-2026-32741","state":"PUBLISHED","title":"libheif has a heap buffer overflow in decode_mask_image()","description":"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.","publishedAt":"2026-05-19T19:57:26.525Z","updatedAt":"2026-07-15T01:07:42.833Z","severity":{"score":7.1,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H","source":"GitHub_M"},"assigner":"GitHub_M","products":["strukturag libheif"],"affected":[{"vendor":"strukturag","product":"libheif","versions":[{"version":"< 1.22.0","status":"affected"}]}],"references":["https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q","https://github.com/strukturag/libheif/releases/tag/v1.22.0","https://access.redhat.com/security/cve/CVE-2026-32741","https://bugzilla.redhat.com/show_bug.cgi?id=2480002","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32741.json"],"weaknesses":["CWE-122","CWE-120"],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/32xxx/CVE-2026-32741.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-32741","state":"PUBLISHED","datePublished":"2026-05-19T19:57:26.525Z","dateUpdated":"2026-07-15T01:07:42.833Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-03-13T15:02:00.628Z"},"containers":{"cna":{"title":"libheif has a heap buffer overflow in decode_mask_image()","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"strukturag","product":"libheif","versions":[{"version":"< 1.22.0","status":"affected"}]}],"references":[{"url":"https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q","name":"https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/strukturag/libheif/releases/tag/v1.22.0","name":"https://github.com/strukturag/libheif/releases/tag/v1.22.0","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"HIGH","baseScore":7.1,"baseSeverity":"HIGH","confidentialityImpact":"NONE","integrityImpact":"LOW","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-122","lang":"en","description":"CWE-122: Heap-based Buffer Overflow","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-05-19T19:57:26.525Z"},"source":{"advisory":"GHSA-j3w5-7whq-p37q","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/strukturag/libheif/security/advisories/GHSA-j3w5-7whq-p37q","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-05-20T14:37:31.409194Z","id":"CVE-2026-32741","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-05-20T15:46:03.623Z"}},{"title":"libheif: libheif: Heap buffer overflow vulnerability in image decoding","descriptions":[{"lang":"en","value":"A flaw was found in libheif, a library for decoding and encoding HEIF (High Efficiency Image File Format) and AVIF files. A remote attacker could exploit a heap buffer overflow vulnerability in the MaskImageCodec::decode_mask_image() function by providing a specially crafted HEIF file containing a mask image. This vulnerability occurs because the function copies image data into a buffer without proper size validation, allowing the attacker-controlled input to exceed the allocated memory. Successful exploitation can lead to a denial of service (DoS) and potentially other impacts due to memory corruption."}],"affected":[{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","packageName":"glycin-loaders","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:10"]}],"references":[{"url":"https://access.redhat.com/security/cve/CVE-2026-32741","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2480002","name":"RHBZ#2480002","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32741.json","tags":["x_sadp-csaf-vex"]}],"metrics":[{"other":{"content":{"namespace":"https://access.redhat.com/security/updates/classification/","value":"Important"},"type":"Red Hat severity rating"}},{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"HIGH","baseScore":7.1,"baseSeverity":"HIGH","confidentialityImpact":"NONE","integrityImpact":"LOW","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H","version":"3.1"},"format":"CVSS"}],"problemTypes":[{"descriptions":[{"cweId":"CWE-120","description":"Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"redhat-SADP","orgId":"0b0ca135-0b70-47e7-9f44-1890c2a1c46c","dateUpdated":"2026-07-15T01:07:42.833Z"},"datePublic":"2026-05-19T19:57:26.525Z","timeline":[{"lang":"en","time":"2026-05-19T21:01:40.125Z","value":"Reported to Red Hat."},{"lang":"en","time":"2026-05-19T19:57:26.525Z","value":"Made public."}],"x_adpType":"supplier","x_generator":{"engine":"sadp-cli 1.0.0"}}]}}}