copyright | disclaimer | privacy | contact  
Australia's Leading Computer Emergency Response Team
 
Search this site

 
On this site

 > HOME
 > About AusCERT
 > Membership
 > Contact Us
 > PKI Services
 > Publications
 > Sec. Bulletins
 > Conferences
 > News & Media
 > Services
 > Web Log
 > Site Map
 > Site Help
 > Member login





 

AA-96.21 -- cron/crontab Buffer Overrun Vulnerabilities

Date: 29 January 1998

Click here for printable version
Click here for PGP verifiable version
-----BEGIN PGP SIGNED MESSAGE-----

===========================================================================
AA-96.21                        AUSCERT Advisory
                      cron/crontab Buffer Overrun Vulnerabilities
                                18 December 1996

Last Revised:    29 January 1998

                 Added vendor information.

                 A complete revision history is at the end of this file.

- ---------------------------------------------------------------------------
AUSCERT has received information that vulnerabilities exist in the
cron(8) and crontab(1) programs found in the Unix cron package.

These vulnerabilities may allow local users to gain root privileges.

Exploit information involving these vulnerabilities has been made publicly
available.

The vulnerabilities in the cron package affect numerous vendors and
platforms.  AUSCERT recommends that sites take the steps outlined in
section 3 as soon as possible.

This advisory will be updated as more information becomes available.
- ---------------------------------------------------------------------------

1.  Description

    AUSCERT has received information that vulnerabilities exist in the
    cron(8) and crontab(1) programs.  cron(8) executes commands at
    specified times according to instructions placed in user crontab files.
    crontab(1) is used to install, remove or list the tables used to
    drive the cron daemon.  Both of these programs are installed by
    default.

    Two unrelated vulnerabilities are known to exist in some versions
    of the cron package.

    1.  Command line buffer overrun

	Due to insufficient bounds checking on arguments which are supplied
	by users, it is possible to overwrite the internal stack space of
	the crontab program while it is executing.  By supplying a
	carefully designed argument to the crontab program, intruders may
	be able to force crontab to execute arbitrary commands.  As crontab
	is setuid root, this may allow intruders to run arbitrary commands
	with root privileges.

    2.  Reading environment buffer overrun

	A similar vulnerability exists in the library routine used to
	load environment variables.  This vulnerable routine is used
	in both cron and crontab.  Due to insufficient bounds checking,
	it may be possible for intruders to manipulate cron or crontab
	into executing arbitrary commands with root privileges.

    Both of these vulnerabilities are known to be present in the Vixie
    cron package, up to and including version 3.0.  This package is
    installed by default under some versions of Unix.  The Vixie cron
    package may have also been installed as third party software by sites.

    The following command may be used to indicate whether a version
    of cron based on Vixie cron is installed:

	# strings /usr/bin/crontab | grep -i vix

    Sites which have versions based on Vixie cron should consider themselves
    vulnerable unless they have specific information from their vendors
    which suggests otherwise.

    Other versions of the cron package supplied by vendors may also be
    vulnerable (Section 3).

    Exploit information involving these vulnerabilities has been made
    publicly available.

2.  Impact

    Local users may gain root privileges.

3.  Workarounds/Solution

    AUSCERT recommends that sites limit the possible exploitation of these
    vulnerabilities by immediately removing the setuid permissions on
    crontab(1) and checking the contents of crontab files as stated
    in Section 3.1.

    Vendor information about the vulnerabilities described in this
    advisory is provided in Section 3.2.

    If the cron functionality is required for non privileged users, and
    no vendor information or patches are available (Section 3.2), AUSCERT
    recommends that access be restricted to a trusted set of users as
    given in Section 3.3.

3.1 Remove setuid and non-root execute permissions and check crontab files

    AUSCERT recommends that the setuid permissions be removed from the
    crontab program immediately.  As the crontab program will no longer
    work for non-root users, it is recommended that the execute permissions
    also be removed.

    For example:

	# ls -l /usr/bin/crontab
	-r-sr-xr-x   1 root     bin    20480 Jun 10  1996 /usr/bin/crontab

	# chmod 500 /usr/bin/crontab
        # ls -l /usr/bin/crontab
	-r-x------   1 root     bin    20480 Jun 10  1996 /usr/bin/crontab

    Note that this will remove the ability for any non-root user to run the
    crontab program.

    This will prevent further exploitation of the crontab vulnerabilities
    described in this advisory.

    In addition, to ensure that cron can not be exploited through existing
    user crontab files, sites should check the contents of all existing
    crontab files for unusual contents.  Unusual contents may include very
    long lines or lines containing non-ASCII characters.  If strange
    environment settings or other unusual entries are found, it may
    indicate a possible attack.   User crontab files are usually located
    in either /var/cron/tabs or /var/spool/cron.

3.2 Vendor information

    Below is a list of vendors which are known to be affected by the
    crontab vulnerabilities described in this advisory:

	FreeBSD, Inc
	NetBSD Project
	RedHat Linux

    The following vendors have informed AUSCERT that they are not
    vulnerable to these vulnerabilities:

        Digital Equipment Corporation
	Hewlett Packard
	IBM Corporation
	Sun Microsystems
	The OpenBSD project

    If your vendor's name is not listed above, please contact your vendor
    directly.

    For more specific vendor information, see Appendix A.

3.3 Restrict crontab access

    If the cron functionality is required by a small set of trusted users,
    sites may wish to restrict the execution of crontab to that group
    of users.  For example, if the Unix group "trusted" exists and contains
    only those users allowed to use the cron functionality, the following
    commands will restrict its use:

       # chgrp trusted /usr/bin/crontab
       # chmod 4750 /usr/bin/crontab
       # ls -l /usr/bin/crontab
       -rwsr-x---   1 root    trusted   20480 Jun 10  1996 /usr/bin/crontab

    Access to any account in the "trusted" group will allow vulnerable
    versions of the cron package to be exploited.

    It should be noted that the use of cron allow/deny files (see
    crontab(1)) will not prevent the exploitation of the command line
    buffer overrun vulnerability.

...........................................................................

Appendix A  Vendor information

This appendix will be updated as we receive additional information.  If
your vendor is not listed below, or you require further vendor information,
please contact the vendor directly.


Digital Equipment Corporation
=============================

  This reported problem is not present for Digital's ULTRIX or
  Digital UNIX Operating Systems Software.


FreeBSD, Inc.  
=============

  FreeBSD versions 1.0, 1.1, 2.1.0, 2.1.5, 2.1.6, 2.1.6.1 and
  2.2 -stable (prior to 16 Dec 1996) and 2.2 -current (prior 
  to 16 Dec 1996) are all affected by the crontab vulnerabilities 
  described in this advisory.

  The FreeBSD Security Team have released an advisory and patch
  information for the crontab vulnerabilities.  This advisory
  (FreeBSD-SA-96:20.stack-overflow) is available from:

  ftp://freebsd.org/pub/CERT/advisories/FreeBSD-SA-96:20.stack-overflow.asc

  Patches are available from:

  ftp://freebsd.org/pub/CERT/patches/SA-96:20/


Hewlett Packard
===============

  The version of crontab shipped with all current versions of 
  HP-UX 9.x and 10.x is not vulnerable to the buffer overflow 
  problems described in this advisory.


IBM Corporation
===============

  The version of crontab shipped with AIX is not vulnerable to the
  buffer overflow conditions listed in this advisory.

  IBM and AIX are registered trademarks of International Business
  Machines Corporation.

Linux (RedHat)
==============

  RedHat Linux version 4.0 is known to be vulnerable.  Earlier
  versions may also be vulnerable.

Sun Microsystems, Inc.
======================

 Sun is not vulnerable to the problem reported in this advisory.

 The Net Project
===============

  All releases of NetBSD up to and including 1.2 appear to be
  vulnerable.  These problems will be fixed in 1.3 and in the
  upcoming bug fix release for 1.2.

The OpenBSD Project
===================

  OpenBSD 2.0 is not susceptible to the vulnerabilities described
  in this advisory.

- ---------------------------------------------------------------------------
AUSCERT thanks Theo de Raadt of the OpenBSD project for his assistance
in the preparation of this advisory.  Thanks also to the vendors who
provided specific product information.
- ---------------------------------------------------------------------------

The AUSCERT team have made every effort to ensure that the information
contained in this document is accurate.  However, the decision to use the
information described is the responsibility of each user or organisation.
The appropriateness of this document for an organisation or individual
system should be considered before application in conjunction with local
policies and procedures.  AUSCERT takes no responsibility for the
consequences of applying the contents of this document.

If you believe that your system has been compromised, contact AUSCERT or
your representative in FIRST (Forum of Incident Response and Security
Teams).

AUSCERT is located at The University of Queensland within the Prentice
Centre.  AUSCERT is a full member of the Forum of Incident Response and
Security Teams (FIRST).

AUSCERT maintains an anonymous FTP service which is found on:
ftp://ftp.auscert.org.au/pub/.  This archive contains past SERT and AUSCERT
Advisories, and other computer security information.

AUSCERT also maintains a World Wide Web service which is found on:
http://www.auscert.org.au/.

Internet Email: auscert@auscert.org.au
Facsimile:	(07) 3365 7031
Telephone:	(07) 3365 4417 (International: +61 7 3365 4417)
		AUSCERT personnel answer during Queensland business hours
		which are GMT+10:00 (AEST).
		On call after hours for emergencies.

Postal:
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld.  4072.
AUSTRALIA


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Revision History

29 Jan 1998    Added vendor information for Digital Equipment Corporation. 
               This has been appended in Appendix A.

18 Aug 1997    Added vendor information for Sun Microsystems. This has been
               appended in Appendix A.

	       Updated AUSCERT postal address.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key

iQCVAwUBNNCO7Ch9+71yA2DNAQHTyQQAhQtg91mv/uOgLr4mSjhkikdfQZhrhZBz
/3aWNhINoAMsBCbfH+JsmpdsAPW6BiWt7zG+gQcygyjkXPLKpWVPTtmMjQeFN7Vp
ZPQkZ5vINLhV4/0bD4kkmSAW6OF0ypSFi/iKkxolEfwrulHpaDXgxSnC/43zse9O
PHGMI/FVxqA=
=q3y1
-----END PGP SIGNATURE-----