CVE-2024-25269 Overview
CVE-2024-25269 is a memory leak vulnerability in libheif versions 1.17.6 and earlier. The flaw resides in the JpegEncoder::Encode function and allows a remote attacker to trigger uncontrolled resource consumption by supplying crafted input to the encoder. Repeated processing of malicious HEIF content exhausts available memory and leads to a denial-of-service condition in any application or service that links against the affected library. The issue is tracked under [CWE-400] (Uncontrolled Resource Consumption) and is documented in the upstream GitHub Issue Tracker Update.
Critical Impact
A remote, unauthenticated attacker can exhaust process memory in services that decode untrusted HEIF images using libheif, resulting in denial of service.
Affected Products
- struktur libheif versions <= 1.17.6
- Applications and services that link against vulnerable libheif builds for HEIF/HEIC processing
- Image conversion pipelines invoking JpegEncoder::Encode
Discovery Timeline
- 2024-03-05 - CVE-2024-25269 published to NVD
- 2025-03-24 - Last updated in NVD database
Technical Details for CVE-2024-25269
Vulnerability Analysis
The vulnerability is a memory leak in the JpegEncoder::Encode function of libheif, an open source HEIF/HEIC codec maintained by struktur AG. When the encoder processes specific inputs, allocated buffers are not released on all code paths. Each call leaves residual memory allocations attributable to the encoding operation. Over many iterations the host process consumes all available memory and terminates or becomes unresponsive.
The attack does not require authentication or user interaction when the library is exposed through a network service such as an upload handler, thumbnail generator, or image conversion API. Confidentiality and integrity are not affected. Availability is the sole impact, consistent with the [CWE-400] classification.
Root Cause
The root cause is improper resource management within the JpegEncoder::Encode code path. Heap allocations used during JPEG output construction are not consistently freed when the function returns. The upstream GitHub Issue Tracker Update documents the leaking allocations and the conditions that trigger them.
Attack Vector
An attacker delivers crafted HEIF input to any application that calls JpegEncoder::Encode through libheif. Common exposure points include web upload endpoints, media transcoding workers, and document processing pipelines. Repeated submissions amplify the leak until the host process or container is killed by the operating system out-of-memory handler.
No verified proof-of-concept code has been published. See the upstream issue tracker for technical reproduction details.
Detection Methods for CVE-2024-25269
Indicators of Compromise
- Sustained growth in resident set size (RSS) of processes that link libheif without a corresponding increase in legitimate workload
- Repeated out-of-memory (OOM) terminations of image processing workers in system logs
- High volume of inbound HEIF/HEIC uploads from a small set of source addresses
Detection Strategies
- Inventory hosts and containers for libheif versions <= 1.17.6 using software composition analysis tools
- Monitor process memory metrics for image conversion services and alert on monotonic growth patterns
- Inspect application logs for repeated invocations of JpegEncoder::Encode followed by worker restarts
Monitoring Recommendations
- Track per-process memory consumption and OOM kill events on systems handling user-supplied images
- Rate-limit and log HEIF/HEIC uploads at the ingress layer to identify abusive clients
- Forward image service telemetry to a centralized analytics platform for correlation across workers
How to Mitigate CVE-2024-25269
Immediate Actions Required
- Upgrade libheif to a version newer than 1.17.6 that contains the fix referenced in the upstream issue
- Rebuild and redeploy any application that statically links libheif after upgrading the library
- Apply request rate limits and size caps on endpoints that accept HEIF/HEIC content
Patch Information
The fix is tracked in the upstream repository under GitHub Issue Tracker Update. Operators should pull a libheif release that incorporates the corrected JpegEncoder::Encode resource handling and verify the linked version through package manager metadata or ldd output.
Workarounds
- Isolate HEIF decoding in short-lived worker processes or containers with strict memory limits so leaks do not accumulate
- Disable HEIF/HEIC ingestion at the application layer until patched builds are deployed
- Restrict accepted image formats at the upload boundary to formats not handled by the vulnerable code path
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


