Article View: news.software.nntp
Article #67710Re: [INN 2.4 source] history/his.c strcmp
From: Jeffrey M. Vinocur
Date: Mon, 19 Jan 2004 20:40
Date: Mon, 19 Jan 2004 20:40
55 lines
2972 bytes
2972 bytes
In article <400BBF16.C7C71F15@comtv.ru>,
Innocenti Maresin <av95@comtv.ru> wrote:
>Hello, all INN users and (particulary) programmers!
Please don't multipost to here and the inn-workers mailing list.
Just pick one.
>[...] about a buffer overflow vulnerability in INN 2.4.0.
>I'm sure that it's not a last discovery of such kind in INN 2.4 :(
Well...I'd say that all in all INN has a pretty good record.
>#0 0x40091d04 in strcmp () from /lib/libc.so.6
>#1 0x0804bb03 in HISopen (path=0x0, method=0x0, flags=11) at his.c:141
>#2 0x0804b757 in main (argc=134733600, argv=0xbffffe04) at makehistory.c:862
Yup, you did find a bug. I suspect your configuration does not
have "hismethod" defined in inn.conf (a new parameter in recent
versions, although it should have been added for you
automatically if installed with `make update`).
> for (i = 0; i < NUM_HIS_METHODS; ++i) {
> if (strcmp(method, his_methods[i].name) == 0)
> break;
> }
>
>I.e. program performs
>a non-length-limited comparision (strcmp) of 2 unknown strings,
Well, they're not unknown. They're guaranteed to be properly
terminated since they come from other parts of INN, and at some
point you have to have invariants or you end up duplicating every
safety check you've ever made.
>and for the "method" string we even haven't a NULL pointer check!
>Evidently, it's this last who gave me memory fault.
So yes, it's a bug. But no, it's not exploitable in any way.
Russ, I still can't authenticate to CVS, can't you fix this?
There's a check in innd/util.c:InndHisOpen() for absence of
innconf->hismethod, but makehistory's call to HISopen() is not
similarly prefaced. I'm not sure whether it's better to copy
that check into makehistory.c, or put a check in HISopen for a
NULL method being passed, or both...
--
Jeffrey M. Vinocur
jeff@litech.org
Technical Details
Message-ID:
<buhfbu$5oj$1@puck.litech.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!hammer.uoregon.edu!news.litech.org!not-for-mailReferences:
<400BBF16.C7C71F15@comtv.ru>Show Full Headers
Complete Article Headers
Message-ID: <buhfbu$5oj$1@puck.litech.org> Subject: Re: [INN 2.4 source] history/his.c strcmp Date: Mon, 19 Jan 2004 20:40:30 +0000 From: jeff@litech.org (Jeffrey M. Vinocur) References: <400BBF16.C7C71F15@comtv.ru> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!hammer.uoregon.edu!news.litech.org!not-for-mail Newsgroups: news.software.nntp Organization: Litech Systems Design Lines: 55 Sender: jeff@litech.org NNTP-Posting-Host: puck.litech.org X-Trace: puck.litech.org 1074544830 5907 66.218.0.75 (19 Jan 2004 20:40:30 GMT) X-Complaints-To: usenet@litech.org NNTP-Posting-Date: Mon, 19 Jan 2004 20:40:30 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: jeff@litech.org (Jeffrey M. Vinocur)