🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #67708

[INN 2.4 source] history/his.c strcmp

#67708
From: Innocenti Maresin
Date: Mon, 19 Jan 2004 11:27
50 lines
2851 bytes
Hello, all INN users and (particulary) programmers!

Ten days ago Russ Allbery posted a message news:87u137422h.fsf@windlord.stanford.edu
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 :(

When I debugged makehistory utility, get crashed (possibly due to my buggy setup),
I saw the following:

(gdb) backtrace
#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
#3  0x4003549d in __libc_start_main () from /lib/libc.so.6

In history/his.c at the specified location you can see:

struct history *
HISopen(const char *path, const char *method, int flags)
{
    struct history *h;
    int i;

    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, 
and for the "method" string we even haven't a NULL pointer check!
Evidently, it's this last who gave me memory fault.

This peece of buggy code has been added to his.c since INN 2.3.2, 
the his.c file had been essentianlly altered 
and even moved from innd/ to history/ subdirectories,
but I found no author/contributor name in the file, only stale 2001 copyright
and some remarks concerning that file in global Changelog.


I tried to setup INN 2.4.0, but just downloaded 2.4.1. 
It has the same code in history/his.c :(



-- 
qq~~~~\	[ ЗА IP БЕЗ ЦЕНЗУРЫ ]
/ /\   \  [ FAQ you ] at news:local.chainik ─ rules at http://www.comtv.ru/~av95/chainik.html
\  /_/ /
 \____/
Technical Details
Message-ID: <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!nf3.bellglobal.com!snoopy.risq.qc.ca!mtu.ru!news.comcor-tv.ru!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <400BBF16.C7C71F15@comtv.ru>
Subject: [INN 2.4 source] history/his.c strcmp
Date: Mon, 19 Jan 2004 14:27:18 +0300
From: Innocenti Maresin <av95@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!nf3.bellglobal.com!snoopy.risq.qc.ca!mtu.ru!news.comcor-tv.ru!not-for-mail
Newsgroups: news.software.nntp
Organization: [ ÚÁ IP ÂÅÚ ÃÅÎÚÕÒÙ ] http://internet.comtv.ru/
Lines: 50
Sender: maresin@comcor-tv.ru
NNTP-Posting-Host: av95.oops
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Trace: news.comcor-tv.ru 1074511638 71357 10.0.0.36 (19 Jan 2004 11:27:18
 GMT)
X-Complaints-To: newsmaster@comcor-tv.ru
NNTP-Posting-Date: Mon, 19 Jan 2004 11:27:18 +0000 (UTC)
X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.23 i586)
X-Accept-Language: ru,en,fr