Bug 238422

Summary: CVE-2007-2356 Stack overflow in gimp's sunras plugin
Product: [Fedora] Fedora Reporter: Lubomir Kundrak <lkundrak>
Component: gimpAssignee: Nils Philippsen <nphilipp>
Status: CLOSED NEXTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: triage
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://milw0rm.com/exploits/3801
Whiteboard: impact=moderate,source=gentoo,public=20070427,reported=20070430 bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-04 08:11:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Lubomir Kundrak 2007-04-30 12:35:09 UTC
+++ This bug was initially created as a clone of Bug #238420 +++

Description of problem:

There is a possible stack-based buffer overrun in function
plug-ins/common/sunras.c:set_color_table() that can be exploited by an
attacker to trigger execution of arbitrary code via crafted Sun RAS file.

Version-Release number of selected component (if applicable):

        Affects: RHEL2.1
        Affects: RHEL3
        Affects: RHEL4
        Affects: RHEL5
        Affects: FC5
        Affects: FC6

Steps to Reproduce:

Either use the program referred to in URL to generate a POC, or use one
that is attached to this bug.

Additional info:

Though I have reproduced a crash on all supported systems, as enumerated
above, for some unknown reason gdb was detaching from the plugin run with
GIMP_PLUGIN_DEBUG=sunras, so I was unable to do a depth-in investigation.
I deduce, that it is a stack overflow because core dumps showed evidence
of corrupt stack, with ssp glibc detects a stack smashing, and Secunia
advisory also states the same:

http://secunia.com/advisories/25012/?answer=57

-- Additional comment from lkundrak@redhat.com on 2007-04-30 08:32 EST --
Created an attachment (id=153788)
Malformed Sun RAS file, that overflows stack in gimp's sunras plugin

Comment 1 Nils Philippsen 2007-04-30 14:28:05 UTC
fc5 -> devel

Comment 2 Nils Philippsen 2007-04-30 15:59:10 UTC
Upstream already has a fix by Sven Neumann, I've extracted that from the SVN
repo and built a fixed gimp-2.2.14-2.fc7 package. Pinged rel-eng to put it into
final.

Comment 3 Nils Philippsen 2007-04-30 16:51:38 UTC
Found small packaging quirk that deleted symlinks to external plugins when
updated, gimp-2.2.14-3.fc7 should be fixed in that regard (which is building
right now). Pinged rel-eng.

Comment 4 Nils Philippsen 2007-04-30 16:52:49 UTC
BTW: Confirmed that the patch actually fixes the bug, i.e. doesn't crash the
plugin but gives a warning about "EOF encountered on reading".

Comment 5 Nils Philippsen 2007-05-01 09:10:12 UTC
Fixed the fix for the quirk mentioned in comment #3 in gimp-2.2.14-5.fc7.

Comment 6 Bug Zapper 2008-04-04 00:23:30 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 7 Lubomir Kundrak 2008-04-04 08:11:21 UTC
Seems already fixed in Rawhide.