libheif has a heap buffer overflow in decode_mask_image() (strukturag libheif)

CVE-2026-32741
HIGH 7.1

En bref

Source
NVD
EPSS
EPSS 0.34 % · centile 28 ()
État
PUBLISHED
Publiée
Mise à jour
Attribuée par
GitHub_M
Statut NVD
Deferred

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.

Faiblesses (CWE)

  • CWE-122 — Débordement de tampon sur le tas
  • CWE-120 — Copie de tampon sans vérification de taille (débordement classique)

Références

Scores

VersionScoreVecteurÉvalué par
CVSS 3.1HIGH 7.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:HGitHub_M
CVSS 3.1HIGH 7.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:Hredhat-SADP
CVSS 3.1HIGH 7.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:HNVD · security-advisories@github.com (Secondary)
CVSS 3.1HIGH 7.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:HNVD · 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary)

Références européennes

Produits affectés

ProduitVersions
strukturag · libheifaffected < 1.22.0

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD