CVE-2026-66758 in Red Hatinfo

Summary

by MITRE • 07/27/2026

A flaw was found in the file-fits plugin in GIMP. When processing a FITS image file, the plugin calculates memory allocation sizes using signed 32-bit integers for width and height. If a crafted file sets both values to large values, their product exceeds 2^31 and overflows, resulting in an undersized heap-based buffer allocation. This integer overflow issue results in a heap-based buffer overflow when cfitsio subsequently writes a full row of pixels in the buffer, causing memory corruption, potentially leading to arbitrary code execution or a denial of service.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 07/27/2026

The vulnerability resides within the file-fits plugin of the GNU Image Manipulation Program GIMP, specifically when handling Flexible Image Transport System image files. This flaw represents a classic integer overflow condition that can escalate into severe memory corruption issues. The root cause stems from the plugin's use of signed 32-bit integers for calculating memory allocation sizes during FITS file processing. When a maliciously crafted FITS file contains large width and height values, the multiplication of these dimensions produces a result exceeding the maximum value storable in a signed 32-bit integer, which is 2^31-1 or 2147483647. This mathematical overflow results in a negative or unexpectedly small calculated buffer size that is then used for heap allocation.

The operational impact of this vulnerability manifests through the subsequent memory corruption when the cfitsio library attempts to write pixel data into the improperly sized buffer. The heap-based buffer overflow occurs because the allocated memory region is insufficient to accommodate the actual data being written by the cfitsio library component. This condition creates a scenario where adjacent memory locations become overwritten, potentially corrupting critical program state information such as return addresses or function pointers. The vulnerability's exploitation potential aligns with CWE-190, which specifically addresses integer overflow conditions that can lead to buffer overflows and memory corruption issues.

Security implications extend beyond simple denial of service to include potential arbitrary code execution capabilities, making this a particularly dangerous flaw in image processing software that handles untrusted input. The attack vector requires an end user to open a specially crafted FITS file within GIMP, which means the vulnerability can be exploited through social engineering or automated delivery mechanisms targeting users who process such files. This type of vulnerability falls under the ATT&CK technique T1203, which covers exploitation of software vulnerabilities through malicious file formats. The integer overflow condition creates a predictable memory layout corruption that could potentially be leveraged by attackers to inject and execute malicious code within the GIMP process context.

Mitigation strategies should focus on immediate patching of the affected GIMP versions, implementing input validation for FITS file dimensions before processing, and employing runtime protections such as stack canaries or address space layout randomization. The fix should involve using larger integer types for dimension calculations or implementing explicit bounds checking to prevent overflow conditions. Additionally, users should exercise caution when opening FITS files from untrusted sources, particularly in environments where GIMP is used for sensitive image processing tasks. Organizations handling large volumes of FITS files should consider implementing automated scanning systems that can detect and quarantine potentially malicious file formats before they reach end-user systems.

Responsible

Redhat

Reservation

07/27/2026

Disclosure

07/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!