# CVE-2026-58380: GNOME GIMP stack buffer overflow in PNM file parser

Source: https://junglewise.ai/threats/cve-2026-58380-gnome-gimp-stack-buffer-overflow-in-pnm-file-parser  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-06. Updated: 2026-07-06  
License: CC BY 4.0 with a link back

CVE-2026-58380 · Severity: high · CVSS 7.3 · Published 2026-07-06

GIMP, a popular open-source image editor, contains a vulnerability in how it processes certain image files (PNM format). If a user is tricked into opening a specially crafted image file, the application may crash or allow an attacker to execute malicious code on the system. This could lead to a full compromise of the user's workstation and unauthorized access to their data.

## Quick answers

**Is CVE-2026-58380 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-58380 being exploited in the wild.

**How severe is CVE-2026-58380?** High severity, with a CVSS score of 7.3, published 6 July 2026.

**Which products and versions are affected?** GNOME GIMP 3.2.1; Red Hat Red Hat Enterprise Linux 7; Red Hat Red Hat Enterprise Linux 8; Red Hat Red Hat Enterprise Linux 9.

**Is there a fix for CVE-2026-58380?** A patch was published on 2026-07-06: Upstream commit 83699817 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-58380 attacked?** It is attacked with local access, in a network appliance.

**Am I affected by CVE-2026-58380?** Check whether anything you run is named in the advisory. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

An off-by-one error exists in the PNM file format parser within GIMP's 'file-pnm.c' component. Specifically, the 'pnmscanner_gettoken()' function uses a loop boundary check (ctr < bufsize) that allows the counter to reach the full size of a 512-byte stack-allocated buffer. When the function subsequently appends a null terminator at 'buf[ctr]', it writes one byte past the end of the buffer. This stack-based buffer overflow can be triggered by a PNM file containing a token of exactly 512 non-whitespace characters. An attacker can exploit this to cause memory corruption, leading to a denial of service or potential arbitrary code execution under the context of the user running GIMP. A fix has been committed to the upstream GNOME repository.

## Affected products

- GNOME GIMP 3.2.1
- Red Hat Red Hat Enterprise Linux 7
- Red Hat Red Hat Enterprise Linux 8
- Red Hat Red Hat Enterprise Linux 9

## Timeline

- 2026-07-01: disclosed: Reported via Red Hat Bugzilla
- 2026-07-06: advisory: NVD publication date
- 2026-07-06: patched: Upstream commit 83699817 released

## References

- [https://access.redhat.com/downloads/content/package-browser/](https://access.redhat.com/downloads/content/package-browser/)
- [https://access.redhat.com/security/cve/CVE-2026-58380](https://access.redhat.com/security/cve/CVE-2026-58380)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2496135](https://bugzilla.redhat.com/show_bug.cgi?id=2496135)
- [https://gitlab.gnome.org/GNOME/gimp/-/commit/83699817](https://gitlab.gnome.org/GNOME/gimp/-/commit/83699817)
- [https://gitlab.gnome.org/GNOME/gimp/-/issues/16206](https://gitlab.gnome.org/GNOME/gimp/-/issues/16206)
