Great Circle Associates Firewalls
(December 1995)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: FW: chroot/setuid vs type enforcement
From: Darren Reed <avalon @ coombs . anu . edu . au>
Date: Tue, 5 Dec 1995 23:34:21 +1100 (EDT)
To: anton @ the-wire . com (Anton J Aylward)
Cc: william . wells @ damark . com, firewalls @ GreatCircle . COM
In-reply-to: <199512050131 . UAA10113 @ psyche . the-wire . com> from "Anton J Aylward" at Dec 4, 95 08:31:51 pm

In some mail from Anton J Aylward, sie said:
[...]
> For example, the buffer overflow problems we've seen between the 
> Morris work and other things recently were becuase the programmer
> never imagined the application would have to deal with perverse SOBs
> shoving extra stuff down.  Then when we saw how the Morris worm 
> worked, we were collectively guilty of not imagining it was a technique 
> which could be used elsewhere.

A digression...

It doesn't take imagination to look at a function or system call, the
parameters it takes, and extremes of input.  This is part of formal
design/testing for software; or so I thought.

gets() is not a case of imagining peverse input, but simply what is the
range of legal input values and can my buffer handle them all ?  Same
for most buffer related code.  Peverse input only matters when you start
parsing it, sometimes producing unexpected output.

If you read in input using fgets(), is there room for a NULL on the end ?
Do you put one there, anyway ?  Do you do this before searching for any
text (such as newline) in the buffer ?  IMHO, very simple things.

At NS'95, on the Saturday morning there was a tute. "Security and the
World Wide Web", taken by John Stewart of Cisco Systems, which had a
largish section on programming using shells, perl and C, in a secure
fashion.  There wasn't anything astounding mentioned, nothing requiring
imagination of weird input, except maybe for shells/perl and the presence
of ``.  Most of it was common sense when doing things like sprintf, strcpy,
gets, etc.  If you'd like a copy of the notes, you should be able to email
the Network Security Institute (who ran it), at:
nsi @
 fedunix .
 org

The moral here is not necessrily be imaginative; just don't make assumptions
that everything will be correct in the real world.

darren


Follow-Ups:
References:
Indexed By Date Previous: Re: Linux/freeBSD & Firewalls for a Newbw :-) (fwd)
From: peter @ nmti . com (Peter da Silva)
Next: Re: tn3270 proxy summary
From: "Paul D. Robertson" <proberts @ clark . net>
Indexed By Thread Previous: Re: FW: chroot/setuid vs type enforcement
From: Anton J Aylward <anton @ the-wire . com>
Next: Re: FW: chroot/setuid vs type enforcement
From: mdr @ vodka . sse . att . com

Google
 
Search Internet Search www.greatcircle.com