{"id":"CVE-2026-32741","published":"2026-05-19T19:57:26Z","modified":"2026-07-15T01:07:42Z","title":"libheif has a heap buffer overflow in decode_mask_image()","vendor":"strukturag","product":"libheif","tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0046,"percentile":0.40777,"provenance":"source"},"cwes":[{"id":"CWE-122","name":"Heap-based Buffer Overflow"},{"id":"CWE-120","name":"Buffer Copy without Checking Size of Input"}],"references":[{"url":"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","tags":["x_refsource_MISC"]},{"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","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"]}],"priority":{"score":13.1,"factors":[{"name":"EPSS percentile","points":8.16},{"name":"CVSS severity","points":4.97}]},"vendorSlug":"strukturag","affectedVersions":[{"vendor":"strukturag","product":"libheif","versions":["< 1.22.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-05-20T14:37:31.409194Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-30982","exploited":false,"provenance":"source"}}