OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Alan DeKok (alandGILES.STRIKER.OTTAWA.ON.CA)
Date: Tue Feb 13 2001 - 14:54:00 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    gabriel rosenkoetter <grECLIPSED.NET> wrote:
    > On Sun, Feb 11, 2001 at 12:38:02AM +0100, Flatline wrote:
    > > When crontab has determined the name of the user calling crontab (using
    > > getpwuid()),
    > > the login name is stored in a 20 byte buffer using the strcpy() function
    > > (which does no bounds checking).

      This is obviously a problem.

    > > 'useradd' (the utility used to add users to the system)
    > > however allows usernames of over 20 characters (32 at most on my distribution).
    > >
    > > Therefore, running crontab as a user whose login name exceeds 20 characters
    > > crashes it.
    >
    > Then your useradd is broken and doing improper bounds checking.

      Nonsense. Some OS's *may* allow usernames longer than 8
    characters. Applications which are broken on such systems are broken
    applications.

      There's a serious difference between an app saying "I can't handle
    that username", and the app crashing and burning. Well behaved
    applications are the cornerstone of security. Ill-behaved
    applications are (almost by definition) insecure.

    > I'm not sure why Vixie chose 20 characters, but it should be enough,
    > since usernames longer than 8 characters should not be expected to
    > behave properly. (They system won't know they're unique.) This is a
    > POSIX thing, last I heard.

      So? Does this mean that it's OK to write applications that have
    buffer over-runs and security holes when run on systems other than
    yours?

      I find this attitude amazing. You don't understand why other people
    would want to have usernames longer than 8 characters, so you're
    willing to blame *their* systems for security problems when insecure
    applications are executed on those systems.

      Alan DeKok.