Skip to main content

libheif CVE-2026-142504

| EUVDEUVD-2026-141720 MEDIUM
Improper Validation of Specified Quantity in Input (CWE-1284)
2026-12-02 VulnCheck GHSA-r9x8-ww5h-wm7q
6.0
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Deliver crafted HEIF file to victim
  2. Delivery
    Victim opens file in libheif-based app
  3. Exploit
    Decode yields lower bit depth than handle reports
  4. Execution
    App reads planes at wrong bit depth
  5. Impact
    Out-of-bounds read crashes app or leaks memory

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Input size validation
Exploitation Conditions

Exploitation requires a crafted HEIF/HEIC file containing one of three triggers documented by the vendor: (1) a codec configuration box (hvcC/av1C) whose bitDepthLumaMinus8/bitDepthChromaMinus8 contradicts the actual bitstream, (2) a 'grid' image with tiles of differing bit depths (where a discarded error since libheif 1.19.0 lets a mismatched tile decode non-deterministically due to parallel tile decoding), or (3) an 'iovl' overlay whose first input image has more than 8 bits per sample (behavior present since 1.4.0 and reproducible even with vendor-written files). The out-of-bounds read does NOT occur inside libheif - it only occurs in a calling application that decodes without requesting a specific colorspace/chroma format AND reads decoded planes using the bit depth from heif_image_handle_get_luma_bits_per_pixel()/heif_image_handle_get_chroma_bits_per_pixel() instead of from the decoded image. Key limiting factors: the victim must open the attacker's file (UI:P/UI:R), the application must misuse the handle bit depth (applications that read bit depth from the decoded image via heif_image_get_bits_per_pixel_range(), or request a specific colorspace/chroma, are not affected - this is the documented workaround), and the grid variant is race-dependent and non-deterministic. Affected versions are <= 1.23.5; the complete fix is updating to 1.23.6.

Impact

This is a moderate-severity, defense-in-depth style library flaw rather than a drop-everything emergency. The supplied CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:P, score 6.0) correctly signals that exploitation is network-delivered but gated by high attack complexity, a specific attack requirement (AT:P), and passive user interaction - the victim must open an attacker-supplied HEIF/HEIC file. Impact is memory disclosure (VC:L) or application crash/DoS (VA:H), with no integrity impact, which matches the CWE-1284/CWE-252 root cause (libheif reports a bit depth the decoded image contradicts; the out-of-bounds read occurs in the CALLING application, not inside libheif). No EPSS score and no CISA KEV status were provided in the input, and there is no indication of active exploitation. The GHSA includes a diagnostic proof-of-concept program, but it merely prints the mismatched bit depths - a public PoC reference exists; it is not verified as working exploit code against a real application. The vuln.today decision label is 'this_month' (not act_now/emergency), consistent with a patch-available, non-actively-exploited library bug. The most important caveat for prioritization: whether a given deployment is actually exploitable depends entirely on how the downstream application consumes libheif (see exploitation_conditions) - the library itself never reads or writes out of bounds, so the real-world risk is conditional on application code, not universal across all libheif users.

Exploit ScenarioDerived

An attacker crafts a HEIF/HEIC file whose hvcC or av1C configuration box advertises a higher bit depth (e.g. 10/16-bit) than the actual decoded bitstream (8-bit), or uses mixed-depth grid tiles or a >8-bit iovl overlay, and delivers it to a victim (email attachment, web upload, messaging app) who opens it in an image viewer built on libheif. If that application decodes without requesting a specific colorspace/chroma and reads the decoded planes using the handle-reported bit depth, it reads past the end of the plane buffer, crashing the process or leaking adjacent heap memory into the processed image. A diagnostic PoC in the vendor advisory demonstrates the bit-depth mismatch but is not a weaponized exploit.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Dec 02, 2026

Bit depth mismatch in libheif through 1.23.5 lets a crafted HEIF/HEIC file make the decoded image's sample depth differ from the value heif_image_handle_get_luma_bits_per_pixel() or heif_image_handle_get_chroma_bits_per_pixel() returns, so a calling application that trusts the handle value and reads 16-bit samples from an 8-bit plane performs an out-of-bounds read - crashing the application or exposing memory contents through the processed picture. Three triggers are documented: an hvcC/av1C configuration box that contradicts the bitstream, a grid item whose tiles have differing bit depths (the mismatch is even non-deterministic because tiles decode in parallel), and an iovl overlay of an image with more than 8 bits per sample. The out-of-bounds access does not occur inside libheif itself and only materialises in applications that decode without requesting a specific colorspace/chroma format and take the depth from the handle; a public PoC reference exists in the vendor advisory, but it is not verified as working exploit code and no confirmed active exploitation is reported.

RemediationAI

Update libheif to 1.23.6, which adds the post-decode depth consistency check, enforces identical tile formats in grid items, and sizes the overlay canvas from its first input image; the release is at https://github.com/strukturag/libheif/releases/tag/v1.23.6 with the corresponding commits 770b0d8d7e1e57b0f4d2b8dc53ff3f82b712fbac (grid format checking and error propagation) and 64a5bba75ad64aa8c010b8ad61e32091025442b3, and details are in the advisory https://github.com/strukturag/libheif/security/advisories/GHSA-vv35-6hxg-95x8. Where the library cannot be rebuilt immediately, the vendor documents two application-side workarounds that eliminate the out-of-bounds read: read the bit depth from the decoded image with heif_image_get_bits_per_pixel_range() instead of from heif_image_handle_get_luma_bits_per_pixel()/heif_image_handle_get_chroma_bits_per_pixel(), or request a specific colorspace and chroma format when calling heif_decode_image() so the plane layout is known in advance - both require code changes in the consuming application rather than configuration, and the second constrains the output format the caller receives. Neither workaround fixes the underlying grid defect, in which a mismatched tile is silently omitted and the decoded grid is incomplete without an error being reported, so updating remains the only complete remedy.

Affected VersionsENISA

libheif 0 <1.23.6

Affected Packages

euvd libheif fix: 1.23.6

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

HEIF is an ISO-BMFF container format in which still images are stored as coded image items; libheif is the reference decoding library used by many image viewers, thumbnails and conversion tools. Each item carries a configuration box - hvcC for HEVC, av1C for AV1 - whose bitDepthLumaMinus8 and bitDepthChromaMinus8 fields advertise the sample depth, and libheif's heif_image_handle_get_luma_bits_per_pixel()/get_chroma_bits_per_pixel() read that advertised value. The actual decoded planes get their depth from the bitstream, and libheif validated only the decoded size against the file, not the depth, which is the improper validation of a specified quantity described by CWE-1284 (the GHSA also classifies it under CWE-252, unchecked return value). The grid path compounds this: ImageItem_Grid::decode_and_paste_tile_image() builds the canvas as a clone of the first decoded tile and calls HeifPixelImage::copy_image_to() for each tile, which rejects a tile of different depth, but since version 1.19.0 the returned error was discarded, so the tile was silently dropped, its area left zero, and decoding reported success - with the canvas depth depending on which parallel tile thread finished first. For iovl overlays, the handle has reported the bit depth of the first input image since version 1.4.0 while ImageItem_Overlay::decode_overlay_image() always composed onto an 8-bit canvas (and composed samples byte-by-byte, so such overlays decoded incorrectly anyway). The fix in 1.23.6 adds a post-decode check that the decoded image's depth matches the handle, makes check_tile_format() enforce identical colorspace, chroma format, component list, datatypes and bit depths across grid tiles (for both whole-grid and single-tile decoding), and sizes the overlay canvas from its first input image.

Know when Libheif gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 6.0 MEDIUM
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 5.9 MEDIUM

Remote crafted file but AC:H because exploitation needs contradictory boxes/mixed tiles and a vulnerable application API usage; UI:R to open the file; C:L memory disclosure, A:H crash/DoS, no integrity impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

libheif before 1.23.6 fails to verify that decoded images match the bit depth reported by the image handle, causing out-of-bounds reads in calling applications. Attackers can supply crafted HEIF files with contradicting hvcC or av1C boxes, mixed-depth grid tiles, or iovl overlays to crash applications or disclose memory.

Threat Intelligence Overview

Prevalence
High
de-facto HEIF/HEIC decoding library across Linux desktops and image tooling
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
High

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2023-49464 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the function UncompressedImageCodec::get_luma_bit

CVE-2023-49463 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the function find_exif_tag at /libheif/exif.cc. R

CVE-2023-49462 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the component /libheif/exif.cc. Rated high severi

CVE-2023-49460 HIGH POC
8.8 Dec 07

libheif v1.17.5 was discovered to contain a segmentation violation via the function UncompressedImageCodec::decode_uncom

CVE-2019-11471 HIGH POC
8.8 Apr 23

libheif 1.4.0 has a use-after-free in heif::HeifContext::Image::set_alpha_channel in heif_context.h because heif_context

CVE-2024-41311 HIGH POC
8.1 Oct 15

In Libheif 1.17.6, insufficient checks in ImageOverlay::parse() decoding a heif file containing an overlay image with fo

CVE-2024-25269 HIGH POC
7.5 Mar 05

libheif <= 1.17.6 contains a memory leak in the function JpegEncoder::Encode. Rated high severity (CVSS 7.5), this vulne

CVE-2025-68431 HIGH POC
7.1

Out-of-bounds read in libheif's HEIF/HEIC overlay processing can disclose limited memory contents and crash affected app

CVE-2023-29659 MEDIUM POC
6.5 May 05

A Segmentation fault caused by a floating point exception exists in libheif 1.15.1 using crafted heif images via the hei

CVE-2025-29482 MEDIUM POC
6.2 Apr 07

Buffer Overflow vulnerability in libheif 1.19.7 allows a local attacker to execute arbitrary code via the SAO (Sample Ad

CVE-2026-84383 CRITICAL
9.8 Sep 04

Heap-based buffer overflow in libheif before 1.23.2 allows remote attackers to corrupt memory and potentially achieve co

CVE-2026-32740 HIGH
8.8 May 19

Heap buffer overflow write in libheif (versions ≤ 1.21.2) lets a crafted HEIF/AVIF file write 64 bytes of attacker-contr

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy