CVE-2025-5473 Overview
CVE-2025-5473 is an integer overflow vulnerability [CWE-190] in GIMP's ICO file parser that enables remote code execution. The flaw stems from insufficient validation of user-supplied data during ICO image parsing, leading to an integer overflow before a memory write operation. An attacker who convinces a user to open a crafted ICO file or visit a malicious page hosting one can execute arbitrary code in the context of the GIMP process. The issue was reported through the Zero Day Initiative as ZDI-CAN-26752 and addressed in GIMP 3.0.4.
Critical Impact
Successful exploitation allows arbitrary code execution on the victim's system with the privileges of the GIMP process, compromising confidentiality, integrity, and availability.
Affected Products
- GIMP versions prior to 3.0.4
- GIMP packages distributed by Debian (addressed via Debian LTS advisory)
- GIMP installations on Windows, Linux, and macOS that process untrusted ICO files
Discovery Timeline
- 2025-05-18 - GIMP 3.0.4 released with the bug fix
- 2025-06-06 - CVE-2025-5473 published to NVD
- 2025-11-03 - Last updated in NVD database
Technical Details for CVE-2025-5473
Vulnerability Analysis
The vulnerability resides within GIMP's parser for the Windows ICO image format. ICO files contain a directory of image entries, each with width, height, color depth, and size fields. The parser computes buffer sizes from these attacker-controlled fields without sufficient bounds checking. When the arithmetic result exceeds the range of the integer type used to hold it, the value wraps around to a small number. GIMP then allocates an undersized buffer based on the wrapped value but proceeds to write the full attacker-supplied data into it, producing a heap memory corruption condition.
Exploitation requires user interaction: the victim must open a malicious .ico file or visit a page that delivers one. Because GIMP is commonly invoked as a default handler for image assets, social-engineering delivery is straightforward. Code executes with the privileges of the user running GIMP.
Root Cause
The defect is classified as an integer overflow leading to an undersized allocation [CWE-190]. The ICO parser performs size calculations on untrusted header fields without validating that intermediate products and sums fit within the destination integer type. The subsequent memory write uses the original (un-wrapped) length, overflowing the heap allocation.
Attack Vector
The attack vector is network-reachable through file delivery: email attachments, drive-by downloads, shared file repositories, or web pages instructing users to open an ICO asset in GIMP. No authentication is required, and the attack complexity is low. Refer to the Zero Day Initiative Advisory ZDI-25-321 for additional context on the disclosure.
No public proof-of-concept code is described in the verified references, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog at this time.
Detection Methods for CVE-2025-5473
Indicators of Compromise
- Unexpected GIMP process crashes or abnormal terminations immediately after opening an ICO file
- Child processes spawned by gimp or gimp-3.0 that execute shells, scripting interpreters, or networking utilities
- ICO files with malformed directory entries, unusually large dimension fields, or size values inconsistent with the file's actual length
Detection Strategies
- Inspect installed GIMP versions across the fleet and flag any release earlier than 3.0.4
- Hunt for process-lineage anomalies where gimp spawns cmd.exe, powershell.exe, /bin/sh, bash, or other living-off-the-land binaries
- Apply file-format scanners to detect ICO files whose header dimensions or bSizeInBytes fields would trigger integer overflow when multiplied
Monitoring Recommendations
- Enable endpoint telemetry that captures process creation, command-line arguments, and parent-child relationships for image-editing applications
- Alert on outbound network connections originating from the GIMP process, which would be atypical for normal image-editing workflows
- Monitor email gateways and web proxies for .ico attachments and downloads originating from untrusted sources
How to Mitigate CVE-2025-5473
Immediate Actions Required
- Upgrade GIMP to version 3.0.4 or later on all systems, including developer workstations and design endpoints
- Apply distribution patches such as those published in the Debian LTS Announcement for managed Linux fleets
- Instruct users to avoid opening ICO files received from untrusted sources until patching is verified
Patch Information
The vendor fix is included in GIMP 3.0.4, released on 2025-05-18. Details are documented in the GIMP 3.0.4 Release Notes. Linux distributions including Debian have backported the fix; administrators should consult their distribution's security tracker and apply the relevant package update.
Workarounds
- Disassociate the .ico file extension from GIMP so untrusted files do not auto-open in the vulnerable parser
- Use a sandboxed environment, such as Flatpak with restricted permissions, when handling ICO files of unknown provenance
- Block inbound .ico attachments at email gateways and strip ICO files from untrusted web traffic where feasible
# Verify the installed GIMP version on Linux
gimp --version
# Upgrade on Debian/Ubuntu after the vendor patch is available
sudo apt update && sudo apt install --only-upgrade gimp
# Verify the installed GIMP version on Windows (PowerShell)
Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" | \
Where-Object { $_.DisplayName -like "*GIMP*" } | \
Select-Object DisplayName, DisplayVersion
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

