Bug 137266 - CAN-2004-0989 multiple buffer overflows
Summary: CAN-2004-0989 multiple buffer overflows
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libxml2
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: CVE-2004-0989
TreeView+ depends on / blocked
 
Reported: 2004-10-27 02:10 UTC by Josh Bressers
Modified: 2008-01-29 09:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-28 14:47:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Josh Bressers 2004-10-27 02:10:16 UTC
The following information has been posted to bugtraq.

http://www.securityfocus.com/archive/1/379383/2004-10-24/2004-10-30/0

Details:

1]The vulnerable code occurs in the file nanoftp.c in function
xmlNanoFTPScanURL() around line 360:

    while (cur[0] != ']')
        buf[indx++] = *cur++;
             

buf is the stack buffer, and cur is the URL we control.  What's funny
here, is that in other areas of the code the same mistake is avoided,
we have this:

    while ((cur[0] != ']') && (indx < XML_NANO_MAX_URLBUF-1))
        buf[indx++] = *cur++;

Which occurs in a similar function to the one called above.
  

2]The vulnerable code occurs in the file nanoftp.c in function
xmlNanoFTPScanProxy() around line 610:

    while (cur[0] != ']')
        buf[indx++] = *cur++;
             

buf is the stack buffer, and cur is the URL we control.


3]There are two different functions, with three different code
sections each containing two overflows.  However I'd classify this as
two distinct bugs, not six, as two of the bugs are conditionally
compiled in only if two others are not.  The first two occur in the
file nanoftp.c, lines 1110-1120, in the function xmlNanoFTPConnect().
 The function getaddrinfo() is called to resolve a hostname, the
returned info is then copied into a heap buffer in a call to memcpy().
 The copy length is taken from the DNS reply, rather than using the
size of the destination structure.  The second set occur in
nanohttp.c, lines 1070-1080, in the function xmlNanoHTTPConnectHost().
 Data from getaddrinfo() is again copied incorrectly, this time into a
local stack buffer.  The third set of overflows occurs in nanohttp.c,
lines 1145-1155, in the function xmlNanoHTTPConnectHost().  This time,
gethostbyname() is called, and data is again memcpy()'d into a local
stack buffer using the DNS length instead of destination structure size.

Comment 1 Josh Bressers 2004-10-27 02:10:50 UTC
We'll want to make sure this fix makes it into FC3.

Comment 2 Daniel Veillard 2004-10-27 09:03:03 UTC
Hum, I wanted to make a new release of libxml2/libxslt at the
end of the week, I have a lot of stuff fixed in CVS, I doubt
this can go in FC3...

Daniel

Comment 4 Daniel Veillard 2004-10-28 14:47:24 UTC
libxml2-2.6.15-2 has been pushed as a FC2 security errata
libxml2-2.6.14-2 with just the fixes was released to rawhide for FC3

  So I think this issue is closed now,

  thanks,

Daniel


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