Bug 211484 - CVE-2006-4810 texindex buffer overflow
Summary: CVE-2006-4810 texindex buffer overflow
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: texinfo
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Miloslav Trmač
QA Contact: Ben Levenson
URL:
Whiteboard: impact=moderate,source=redhat,embargo...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-19 17:42 UTC by Josh Bressers
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHSA-2006-0727
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-08 10:02:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2006:0727 0 moderate SHIPPED_LIVE Moderate: texinfo security update 2006-11-08 10:02:05 UTC

Description Josh Bressers 2006-10-19 17:42:00 UTC
Miloslav Trmac found a heap overflow in the way texindex handles data from
certain index files.

The texindex utility contains a heap overflow; when the data for a
generated index is larger than 500,000 bytes, an incorrect reallocation
code in readline() allows heap overflow by index lines longer than 400
bytes.


It looks like the code in readline() of texindex.c has some crazy arithmetic.

 char *buffer = linebuffer->buffer;
 char *p = linebuffer->buffer;
 char *end = p + linebuffer->size;

 while (1)
 {
  int c = getc (stream);
  if (p == end)
  {
   buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
   p += buffer - linebuffer->buffer;
   end += buffer - linebuffer->buffer;
   linebuffer->buffer = buffer;

It would seem that when p == end, p and end are assigned what could be a random
memory addresses as the location of buffer is likely to change with a realloc
from a size of 200 to 400 bytes. p then proceedes to dump trash on the heap
until the current line ends.

Comment 1 Josh Bressers 2006-10-19 17:44:11 UTC
This issue also affects RHEL2 and RHEL3

Comment 7 Mark J. Cox 2006-11-08 08:56:29 UTC
removing embargo

Comment 8 Red Hat Bugzilla 2006-11-08 10:02:24 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2006-0727.html



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