Bug 2496135 (CVE-2026-58380) - CVE-2026-58380 gimp: gimp: Stack buffer overflow in pnmscanner_gettoken()
Summary: CVE-2026-58380 gimp: gimp: Stack buffer overflow in pnmscanner_gettoken()
Keywords:
Status: NEW
Alias: CVE-2026-58380
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-07-01 19:11 UTC by OSIDB Bzimport
Modified: 2026-07-06 13:41 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-07-01 19:11:31 UTC
An off-by-one stack buffer overflow exists in GIMP's PNM file format parser. In pnmscanner_gettoken() in file-pnm.c, the loop condition ctr < bufsize allows ctr to reach bufsize (512), then buf[ctr] = '\0' writes one byte past the 512-byte stack buffer. The function is called from pnm_load_ascii() with a stack-allocated buf[BUFLEN] where BUFLEN = 512, with no extra room for the null terminator.

- Function: pnmscanner_gettoken()
- File: plug-ins/common/file-pnm.c:2103-2122
- Fix: https://gitlab.gnome.org/GNOME/gimp/-/commit/83699817
- Upstream issue: https://gitlab.gnome.org/GNOME/gimp/-/issues/16206
- Acknowledgment: bb1abu


Note You need to log in before you can comment on or make changes to this bug.