Bug 233164 (CVE-2007-1536) - CVE-2007-1536 file 4.20 fixes a heap overflow in that can result in arbitrary code execution
Summary: CVE-2007-1536 file 4.20 fixes a heap overflow in that can result in arbitrary...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: CVE-2007-1536
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Martin Bacovsky
QA Contact:
URL:
Whiteboard:
Depends On: 233161
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-20 18:53 UTC by Lubomir Kundrak
Modified: 2019-09-29 12:20 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-03-30 09:08:11 UTC
Embargoed:


Attachments (Terms of Use)

Description Lubomir Kundrak 2007-03-20 18:53:41 UTC
+++ This bug was initially created as a clone of Bug #233161 +++

Description of problem:

The ChangeLog states this:

2007-02-08 17:30 Christos Zoulas <christos>

        * fix integer underflow in file_printf which can lead to
          to exploitable heap overflow (Jean-Sebastien Guay-Lero)

Christos clarifies further:


The crux of the problem is here:

-               if ((buf = realloc(ms->o.buf, len + 1024)) == NULL) {
-                       file_oomem(ms, len + 1024);
+               size = (ms->o.size - ms->o.left) + len + 1024;
+               if ((buf = realloc(ms->o.buf, size)) == NULL) {

Instead of allocating len + 1024 bytes on top of the previous size,
before the fix we allocated just len + 1024 bytes. So if the buffer
was let's say 4K, and we printed a string of len < 3K in this pass,
then we effectively decreased the size of the string instead of
growing it because of the realloc().

christos

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

file-3.* is not affected.
RHEL-3, RHEL-4, RHEL-5, FC-5, FC-6

How reproducible:

No reproducer available.

Comment 1 Josh Bressers 2007-03-20 21:36:45 UTC
The upstream patch can be found here:
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/dist/file/src/funcs.c.diff?r1=1.1.1.10&r2=1.1.1.11&f=h

Comment 2 Martin Bacovsky 2007-03-30 09:08:11 UTC
This issue should be fixed in file-4.19-2.fc6.


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