CVE-2026-47247 Overview
CVE-2026-47247 is an information disclosure vulnerability in libheif, a widely used HEIF and AVIF file format decoder and encoder. Two chained bugs in versions prior to 1.22.0 leak process heap memory as visible pixel values in decoded grid images. An attacker who uploads a crafted AVIF or HEIC file to a server-side image processor such as WordPress, Sharp/libvips, or ImageMagick can recover heap contents from the resulting transcoded JPEG, PNG, or WebP output. Leaked data can include library function pointers sufficient to defeat Address Space Layout Randomization (ASLR) or any other secret residing in adjacent heap memory. Local attack vectors are also feasible. The issue is classified under [CWE-200] and is fixed in libheif version 1.22.0.
Critical Impact
Remote unauthenticated attackers can exfiltrate heap memory, including function pointers used to bypass ASLR, through any web service that transcodes user-supplied HEIF/AVIF images.
Affected Products
- libheif versions prior to 1.22.0
- Applications embedding vulnerable libheif builds, including WordPress, Sharp/libvips, and ImageMagick
- Any server-side image processing pipeline that decodes user-supplied HEIC or AVIF files
Discovery Timeline
- 2026-07-21 - CVE-2026-47247 published to NVD
- 2026-07-22 - Last updated in NVD database
Technical Details for CVE-2026-47247
Vulnerability Analysis
The vulnerability resides in libheif's handling of grid images, a HEIF/AVIF construct that assembles a final image from multiple tile references. Two independent bugs chain together so that memory outside the intended tile buffers is copied into the output pixel array. When the decoded image is transcoded to a lossless or high-quality output format, the leaked bytes remain recoverable as pixel channel values in the resulting JPEG, PNG, or WebP file.
Because libheif runs in the address space of the calling application, the leaked bytes originate from the process heap. Attackers can recover pointers to library functions, canary values, or application secrets stored near the decoder's allocations. Repeated uploads with varied grid geometries allow an attacker to profile the heap layout and reliably extract ASLR-defeating pointers.
Root Cause
The root cause is improper bounds enforcement during grid image assembly combined with a second flaw that causes uninitialized or out-of-range heap memory to be treated as valid tile pixel data. The decoded output faithfully reflects whatever bytes reside at the incorrectly referenced heap offsets, producing an information disclosure primitive rather than a crash.
Attack Vector
An unauthenticated remote attacker crafts a malformed AVIF or HEIC grid image and submits it to any exposed endpoint that decodes and re-encodes images with libheif. The attacker then downloads the transcoded output and reads pixel values to reconstruct leaked heap memory. No user interaction or elevated privileges are required. Consult the GitHub Security Advisory GHSA-2vh6-whr3-cmq3 for the technical write-up.
Detection Methods for CVE-2026-47247
Indicators of Compromise
- Inbound HEIC or AVIF uploads that declare grid-derived image structures with unusual tile counts or dimensions.
- Web server access logs showing repeated uploads of small HEIC/AVIF files followed by downloads of the corresponding transcoded outputs.
- Transcoded images containing high-entropy regions inconsistent with legitimate photographic content.
Detection Strategies
- Inventory all applications and container images that link against libheif and flag versions earlier than 1.22.0.
- Inspect image upload endpoints for HEIF/AVIF payloads that contain grid derivations referencing out-of-range tile indices.
- Correlate upload and download activity on image transcoding services to identify automated extraction patterns.
Monitoring Recommendations
- Alert on unexpected outbound transfers of large volumes of transcoded images from image-processing hosts.
- Log HEIF/AVIF parser errors and decoder warnings emitted by libheif to a centralized logging pipeline.
- Monitor CPU and memory usage on image workers for anomalies indicating repeated crafted-file processing.
How to Mitigate CVE-2026-47247
Immediate Actions Required
- Upgrade libheif to version 1.22.0 or later on every host and container image that decodes HEIF or AVIF content.
- Rebuild and redeploy downstream projects such as ImageMagick, libvips/Sharp, and CMS plugins that statically link or bundle libheif.
- Rotate any secrets that could plausibly have resided in the heap of an internet-facing image processor prior to patching.
Patch Information
The maintainers fixed both underlying bugs in libheif1.22.0. Release details and the coordinated advisory are available in the libheif GitHub Security Advisory GHSA-2vh6-whr3-cmq3. Distribution maintainers have backported the fix into current stable channels; verify package versions with your operating system's package manager.
Workarounds
- Disable HEIF and AVIF decoding in exposed image pipelines until the patched libheif is deployed.
- Restrict image upload MIME types to formats not processed by libheif, such as JPEG and PNG, where feasible.
- Sandbox image decoding workers with seccomp or containerization so that leaked pointers cannot be paired with a second-stage exploit.
# Verify the installed libheif version on Debian/Ubuntu systems
dpkg -l | grep libheif
# Upgrade libheif and dependent packages
sudo apt-get update && sudo apt-get install --only-upgrade libheif1 libheif-dev
# Confirm the runtime version reported by the library
pkg-config --modversion libheif
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

