HIGH 7.3

CVE-2026-58380: GIMP PNM Parser Stack Buffer Overflow – Off-by-One Memory Corruption

GIMP, the popular open-source image editor, contains a memory corruption vulnerability in how it reads PNM image files. When a user opens a malicious PNM file, a coding mistake causes the application to write data slightly outside a memory buffer's intended boundary, which can crash the program or potentially allow an attacker to execute arbitrary code on the system. The flaw requires local access and user interaction (opening a file), but once triggered, the impact is substantial.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.3 HIGH · CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-193
Affected products
4 configuration(s)
Published / Modified
2026-07-06 / 2026-07-16

NVD description (verbatim)

A flaw was found in GIMP's PNM file format parser. When parsing a specially crafted PNM file, the pnmscanner_gettoken() function writes a null terminator one byte past the end of a stack-allocated buffer due to an off-by-one error in the loop boundary check. This could lead to memory corruption, potentially resulting in denial of service or arbitrary code execution.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-58380 is an off-by-one error in GIMP's pnmscanner_gettoken() function within the PNM file format parser. The vulnerability occurs when parsing a specially crafted PNM file: the loop boundary check fails to account for the null terminator, causing the function to write one byte past the allocated stack buffer. This stack-based buffer overflow (CWE-193) corrupts adjacent memory, potentially enabling control-flow hijacking or denial of service depending on memory layout and exploitation conditions.

Business impact

For organizations deploying GIMP in shared environments, image processing workflows, or user-facing graphics editing services, this vulnerability poses a containment risk. Compromise of an editing workstation could escalate to lateral movement if GIMP runs with elevated privileges or in a multi-user environment. The requirement for local access and user action (opening a file) limits exposure to targeted attacks—for example, a crafted PNM file distributed via email or shared storage. However, in security-sensitive image processing pipelines or collaborative design teams, an attacker could deliver a malicious file to achieve code execution on a trusted system.

Affected systems

GIMP itself is directly affected. The vulnerability also impacts Red Hat Enterprise Linux systems that bundle GIMP or include it as part of the default install set, depending on the specific RHEL version and variant. Organizations should verify which RHEL versions in their estate include vulnerable GIMP packages and cross-reference against their patching schedules.

Exploitability

Exploitation requires local system access and user interaction: the victim must open a crafted PNM file in GIMP. The attack surface is primarily limited to scenarios where attackers can reliably deliver a malicious image file—such as email attachments, web uploads parsed by GIMP, or file-sharing platforms. The vulnerability is not remotely exploitable without a separate mechanism to trigger file opening. No public exploit code is currently documented in the known exploited vulnerabilities (KEV) list, though the technical nature of the flaw and its memory-corruption severity make it a plausible target for weaponization.

Remediation

Patch GIMP to a version that corrects the off-by-one error in the pnmscanner_gettoken() function's loop boundary check. Red Hat will issue patched versions of GIMP through its standard security update channels; track RHEL security advisories for exact version numbers. In the interim, restrict file-opening privileges for GIMP in sensitive environments, disable PNM format support if unused, or isolate GIMP workstations from untrusted file sources. User education about not opening image files from untrusted sources is a complementary control.

Patch guidance

Monitor Red Hat's security errata portal for GIMP updates associated with CVE-2026-58380. Apply patches to GIMP and affected RHEL packages as soon as testing permits. If your organization uses GIMP from upstream sources (gimp.org), watch for releases that address this off-by-one error in the PNM parser. Coordinate patching with your image processing workflows to minimize disruption; consider staging patches in non-production environments first to validate compatibility with custom plugins or scripts that may interact with PNM parsing.

Detection guidance

Monitor for failed GIMP process execution or crashes triggered by PNM file handling, particularly if unusual files arrive via email or file-sharing systems. Endpoint detection and response (EDR) tools should flag stack-based buffer overflows or abnormal memory access patterns originating from GIMP. Log file-open events in GIMP where feasible and correlate them with file sources. Additionally, watch for post-compromise indicators: unexpected child processes spawned from GIMP, lateral movement attempts originating from a GIMP workstation, or changes to files in image processing directories.

Why prioritize this

This vulnerability merits high priority due to its CVSS 3.1 score of 7.3 (HIGH severity), which reflects high impact (confidentiality, integrity, and availability compromised) and a relatively low barrier to exploitation (local access, low attack complexity). Although it does not yet appear on the KEV list, the combination of memory-corruption severity and direct code-execution potential makes it attractive for targeted attack. Organizations with frequent PNM file handling, graphics workstations, or image-intensive services should prioritize patching within days rather than weeks.

Risk score, explained

The CVSS 3.1 vector CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H yields a score of 7.3 (HIGH). Attack Vector is Local (AV:L) because exploitation requires local system access. Attack Complexity is Low (AC:L), reflecting the straightforward nature of the off-by-one error and lack of complex mitigations. Privileges Required (PR:L) indicates the user must have login capability. User Interaction (UI:R) is required: the user must open a malicious PNM file. The vulnerability impacts only the compromised system (S:U), with all three impact categories (C, I, A) rated High—memory corruption can enable data exfiltration, code modification, and denial of service.

Frequently asked questions

Can this vulnerability be exploited remotely without file interaction?

No. Exploitation requires local system access and the user must explicitly open a crafted PNM file in GIMP. There is no remote, unauthenticated attack vector. However, if a GIMP-based web service automatically processes PNM uploads, the interaction requirement could be met on the server side.

What image file formats are affected by this flaw?

Only PNM (Portable PixMap/Graymap/Bitmap) files trigger this vulnerability, as the bug is specific to the PNM parser's pnmscanner_gettoken() function. Other image formats supported by GIMP (JPEG, PNG, GIF, etc.) are not affected by this particular flaw.

Does this vulnerability appear on CISA's known exploited vulnerabilities list?

As of the current data, CVE-2026-58380 is not listed in the KEV catalog, meaning no active exploitation in the wild has been officially documented. However, the high CVSS score and memory-corruption nature of the flaw make it a potential target for future weaponization.

How do I check if my RHEL or GIMP installation is vulnerable?

Determine your GIMP version via Help > About GIMP (or gimp --version on the command line). Cross-reference the version against Red Hat's security errata to see if your build is listed as vulnerable. For RHEL systems, run rpm -qa | grep gimp to list installed GIMP packages, then consult the corresponding RHEL security advisory for affected package versions.

This analysis is provided for informational purposes only and does not constitute professional security advice. Patch version numbers and timelines should be verified against official Red Hat and GIMP project advisories before deployment. Organizations should conduct their own risk assessments and testing in non-production environments before applying patches. SEC.co makes no warranty regarding the completeness or accuracy of third-party vulnerability data; always consult primary vendor sources for authoritative guidance. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).