CVE-2026-58381: Gimp: gimp: double-free in read_layer_block()

Published Jul 1, 2026
·
Updated

A double-free vulnerability exists in GIMP's Paint Shop Pro (PSP) file format parser. In readlayerblock() in file-psp.c, the variable name is allocated, used, and freed each loop iteration. On the error path in the 2nd iteration, fread fails before gmalloc for name, so the stale pointer from iteration 1 is freed again via gfree(name).

- Function: readlayerblock() - File: plug-ins/common/file-psp.c:1908-2321 - Fix: https://gitlab.gnome.org/GNOME/gimp/-/commit/b22e147b - Upstream issue: https://gitlab.gnome.org/GNOME/gimp/-/issues/16207 - Acknowledgment: bb1abu

Other sources

A flaw was found in GIMP's PSP file format parser. A double-free condition occurs in the readlayerblock() function when processing a specially crafted PSP file. This could allow an attacker to cause memory corruption, potentially leading to denial of service or arbitrary code execution.

— MITRE

Affected Software

10 affected componentsFixes available
GIMP/GNOME GIMP
debian/gimp<=2.10.34-1+deb12u10
3.0.4-3+deb13u103.0.4-3+deb13u113.2.6-13.2.8-1
GIMP GIMP<=3.2.1
redhat Enterprise Linux=6.0
redhat Enterprise Linux=7.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
debian/gimp*
debian/gimp<3.0.4-3+deb13u10
3.0.4-3+deb13u10
debian/gimp<3.2.4-1
3.2.4-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/gimp to a version that resolves this vulnerability.

    Fixed in 3.0.4-3+deb13u10Fixed in 3.0.4-3+deb13u11Fixed in 3.2.6-1Fixed in 3.2.8-1
  2. Upgrade

    Upgrade debian/gimp to a version that resolves this vulnerability.

    Fixed in 3.0.4-3+deb13u10
  3. Upgrade

    Upgrade debian/gimp to a version that resolves this vulnerability.

    Fixed in 3.2.4-1
  4. Upgrade

    Upgrade GIMP to a version that resolves this vulnerability.

    Patch b22e147b

Event History

Jul 1, 2026
Data Sourced
via Red Hat·08:22 PM
DescriptionSeverityAffected Software
Jul 2, 2026
CVE Published
via MITRE·07:45 PM
Data Sourced
via MITRE·07:45 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·08:17 PM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What does an attacker need to exploit this issue?

The attacker needs to provide a specially crafted Paint Shop Pro (PSP) file and have it processed by GIMP. The recorded vector indicates local access, low privileges, and user interaction are required.

2

What can be done while a fix is not yet available?

Avoid opening or processing untrusted PSP files in GIMP. The upstream fix is identified as commit b22e147b.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203