Article View: news.software.nntp
Article #19551What changed 1.6 vs 1.5.1 (preliminary)
From: Forrest J. Cavalier III
Date: Wed, 23 Jul 1997 00:00
Date: Wed, 23 Jul 1997 00:00
99 lines
3989 bytes
3989 bytes
What a mess.
It is a piece of cake to generate patch files to go from 1.5.1 to
1.6. (Anyone can run diff, right?)
But since no-one (not even James) reverse engineered the changes,
I am in the process of doing it.
It is going to take a while.
But just to let everyone in on what I find so far:
1. Yes there are a FEW places where I see security holes that
are fixed with snprintf. But tell me, under what circumstance do you think
sprintf is a security risk with the following code. Was all this hassle
really necessary?
For example:
#define SMBUF 256
. . .
char bytesbuff[SMBUF];
. . .
Perfectly legitimate (i.e. COMPLETELY SAFE) code
near line 646 in innd.art.c
(void)sprintf(bytesbuff, "Bytes: %ld\n", size);
was changed to:
(void)snprintf(bytesbuff, sizeof(bytesbuff), "Bytes: %ld\n", size);
There are many instances of this. And this is for no apparent reason.
Was this a plan for when INT_LONG reaches 100000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000?
Give us a break. What's next? Assigning variables twice, "just to make
sure?"
Don't get me wrong, I code with snprintf as much as I can, but to change
an installed base of software for no good reason is not a good idea.
2. The other 1.6-ism is to replace code like:
(void)strcpy(copy, buff);
with the admittedly safer:
(void)strncpy(copy, buff, sizeof(copy) - 1);
copy[sizeof(copy) - 1] = '\0';
But for heavens sake, couldn't someone define a new function
for the purpose? My personal software library has a function:
void strn0cpy(char *dest,const char *src,int count);
which makes much cleaner code.
At least they used sizeof(copy) instead of some constant.
But if the liberal changing of snprintf is any indication, I
bet there are lots of strcpy()s which were safe that got
arbitrarily changed.
3. I have been thinking about the security hole as announced.
I think it really is an overstatement to say a stack buffer
overrun could be used to "execute arbitrary binary code."
There are so many variable involved that I really don't see
it as a risk. There are so many variables involved of stack
pointer location, compiler choice, INN options, etc, not to
mention CPU instruction set, that I can't see how this hole
could be exploited realistically.
The announcement says that the hole could be used to open
up a shell. Yeah right. Show me how.
I think realistically, someone could crash your INN or corrupt
your history database. And since a crashed INN does not send messages,
it is likely that the sinister message does not propagate very far.
(DNEWS, Diablo, etc might propagate them.)
Anyone else have an opinion on this so-called hole? Anyone have
any indication it was exploited? What am I missing?
Forrest Cavalier, Mib Software, INN customization and consulting
Still working on sorting out all these changes. The CHANGES file
is a *bit* brief. (Major understatement) and the comments on
bug fixes are spotty at best.
Technical Details
Message-ID:
<5r5pq3$6lc$1@news1.epix.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<5r21gd$24r$1@pluto.sm.dsi.unimi.it> <slrn5tcdem.gj6.memory@bigtime.blank.org> <87g1t57jf9.fsf@acropolis.ibm.net> <yy3afjdmw2e.fsf@velo.pp.vix.com> <5r5o4p$s1n$1@flea.best.net>Show Full Headers
Complete Article Headers
Message-ID: <5r5pq3$6lc$1@news1.epix.net> Subject: What changed 1.6 vs 1.5.1 (preliminary) Date: Wed, 23 Jul 1997 00:00:00 +0000 From: mibsoft@epix.net (Forrest J. Cavalier III) References: <5r21gd$24r$1@pluto.sm.dsi.unimi.it> <slrn5tcdem.gj6.memory@bigtime.blank.org> <87g1t57jf9.fsf@acropolis.ibm.net> <yy3afjdmw2e.fsf@velo.pp.vix.com> <5r5o4p$s1n$1@flea.best.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 258424998 Organization: Mib Software Newsgroups: news.software.nntp