CVE-2026-70652 in libvipsinfo

Summary

by MITRE • 08/21/2026

libvips is a fast image processing library with low memory needs. Prior to version 8.18.3, libvips built with libultrahdr support can incorrectly size an output buffer in libvips/foreign/uhdrsave.c within vips_foreign_save_uhdr_set_raw_hdr when a pipeline enlarges an incoming JPEG to a very large output before encoding a gain map through VipsForeignSaveUhdr. The undersized allocation can cause a heap buffer over-read that may disclose adjacent data or crash the process. This issue is fixed in version 8.18.3.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 08/21/2026

The vulnerability identified in libvips, specifically within versions prior to 8.18.3, represents a critical memory safety flaw rooted in improper buffer size calculation during image processing operations involving Ultra High Dynamic Range (UHDR) formats. Libvips is widely utilized for its high performance and low memory footprint, making it a common component in web services, content management systems, and automated media pipelines that handle large-scale image transformations. The specific defect resides in the source file libvips/foreign/uhdrsave.c within the function vips_foreign_save_uhdr_set_raw_hdr. This module is responsible for handling the saving of images into UHDR format, which supports gain maps to enhance dynamic range on compatible displays. When a processing pipeline performs operations that significantly enlarge an incoming JPEG image before encoding it with a gain map using VipsForeignSaveUhdr, the library fails to correctly calculate the required size for the output buffer. This miscalculation results in an undersized memory allocation relative to the actual data volume being written or read during the save operation.

From a technical perspective, this error classifies as CWE-131: Incorrect Calculation of Buffer Size, which often leads directly to CWE-125: Out-of-bounds Read when the application attempts to access memory beyond the allocated bounds. The consequence of this undersized allocation is a heap buffer over-read condition. In practical terms, when the processing engine writes or reads pixel data and metadata into the incorrectly sized buffer, it accesses adjacent memory regions that were not intended for use by this specific operation. This can lead to two primary adverse outcomes: information disclosure or process instability. If an attacker can control the input image dimensions and trigger this code path in a server-side context, they may be able to read sensitive data stored in adjacent heap memory blocks, such as authentication tokens, private keys, or other user credentials. Alternatively, if the access violates memory protection boundaries enforced by the operating system, it will result in an immediate segmentation fault, causing the application process to crash and leading to a denial of service condition for users relying on the image processing service.

The operational impact is particularly severe because libvips is frequently deployed as part of backend infrastructure where untrusted user-uploaded images are processed automatically. An attacker could craft a malicious JPEG file with specific dimensions that, when combined with gain map encoding parameters, trigger the buffer over-read without causing an immediate crash, thereby allowing for stealthy data exfiltration. This aligns with ATT&CK technique T1005: Data from Local System, where adversaries seek to access local files or memory contents. Furthermore, if the vulnerability is triggered in a manner that causes frequent crashes, it constitutes a Denial of Service attack against the service hosting libvips, impacting availability metrics and potentially causing cascading failures in dependent services. The complexity lies in the specific combination of operations: enlarging an image followed by UHDR encoding with gain maps, which may not be triggered by all standard use cases but is plausible in advanced media processing workflows that support dynamic range enhancement features.

Mitigation strategies must prioritize immediate version upgrades to libvips 8.18.3 or later, where the buffer size calculation logic has been corrected to accurately reflect the memory requirements of the output operation. For environments unable to upgrade immediately due to dependency constraints, defensive coding practices should be implemented at the application layer. This includes validating input image dimensions against maximum allowed thresholds before passing them to libvips functions, thereby preventing the trigger condition that leads to excessive buffer allocation requests. Additionally, enabling heap protection mechanisms such as AddressSanitizer during development and testing phases can help detect similar memory errors early in the software lifecycle. Organizations should also implement strict resource limits on their image processing services to mitigate the impact of potential crashes or excessive memory consumption attempts. Regular security audits focusing on C/C++ libraries that handle external inputs are essential, particularly for components dealing with complex binary formats like UHDR where manual buffer management is prevalent.

Responsible

GitHub M

Reservation

08/04/2026

Disclosure

08/21/2026

Moderation

accepted

CPE

ready

EPSS

0.00114

KEV

no

Activities

low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!