From darrenr@cyber.com.au  Tue May 21 02:05:23 1996
Received: from plum.cyber.com.au (plum.cyber.com.au [203.7.155.24]) by suburbia.net (8.7.4/Proff-950810) with SMTP id CAA15013 for <best-of-security@suburbia.net>; Tue, 21 May 1996 02:05:15 +1000
Received: (from darrenr@localhost) by plum.cyber.com.au (8.6.12/8.6.6) id CAA03135 for best-of-security@suburbia.net; Tue, 21 May 1996 02:04:48 +1000
Received: from satay.cyber.com.au (satay.cyber.com.au [203.7.155.20]) by plum.cyber.com.au (8.6.12/8.6.6) with ESMTP id OAA01994 for <auscert-public@CYBER.COM.AU>; Mon, 20 May 1996 14:16:53 +1000
From: auscert@auscert.org.au
Received: (from uucp@localhost) by satay.cyber.com.au (8.7.4/8.7.3) id OAA08010 for <auscert-public@CYBER.COM.AU>; Mon, 20 May 1996 14:09:06 +1000 (EST)
Received: from onyx0.auscert.org.au(203.5.112.10) by satay.cyber.com.au via smap (V1.3)
	id sma008007; Mon May 20 14:08:30 1996
Received: from amethyst.auscert.org.au (amethyst.auscert.org.au [203.5.112.218]) by onyx.auscert.org.au (8.7.5/8.7.1) with ESMTP id OAA10817; Mon, 20 May 1996 14:15:49 +1000 (EST)
Received: (from eric@localhost) by amethyst.auscert.org.au (8.7.5/8.7.2) id OAA27831; Mon, 20 May 1996 14:15:06 +1000 (EST)
Date: Mon, 20 May 1996 14:15:06 +1000 (EST)
Message-Id: <199605200415.OAA27831@amethyst.auscert.org.au>
To: auscert-public@auscert.org.au
Sender: darrenr@cyber.com.au
Reply-To: auscert@auscert.org.au
Errors-To: postmaster@auscert.org.au
Subject: AA-96.02 NIS+ configuration vulnerability
Precedence: list

-----BEGIN PGP SIGNED MESSAGE-----

=============================================================================
AA-96.02                        AUSCERT Advisory
			NIS+ configuration vulnerability
                                  20 May 1996
- -----------------------------------------------------------------------------

AUSCERT has received information that a vulnerability exists under some
configurations of NIS+.  In vulnerable installations of NIS+, the access rights
on the NIS+ passwd table are left in an unsecure state.  

This vulnerability is known to exist in NIS+ installations initially created
on Solaris 2.5 servers.  Similar vulnerabilities in NIS+ configurations may
also exist in previous versions of Solaris 2.

This vulnerability may allow any user with valid NIS+ credentials to gain
root privileges.

AUSCERT recommends that any site which has NIS+ installed take this
opportunity to check their installations and apply the appropriate workarounds
as described in Section 3.

- -----------------------------------------------------------------------------

1.  Description

    NIS+ provides distributed network access to information sources such as
    password, group and host information.  It maintains this information in
    the form of NIS+ tables.  NIS+ tables contain the administrative
    information normally supplied by local files (such as /etc/passwd).  As
    with the standard Unix administration files, setting secure permissions
    on the NIS+ tables is of utmost importance in maintaining system security.

    NIS+ provides a comprehensive set of access rights for NIS+ tables.  This
    includes permissions not only on NIS+ tables but also individual columns
    and entries in those tables.  Due to the added complexity, sites need to
    be particularly diligent in ensuring that permissions on NIS+ tables (and
    associated entries and columns) are secure.

    AUSCERT encourages sites running NIS+ to gain a good understanding of
    the permission model used by NIS+.  A complete description may be found
    in the NIS+ documentation set.  The rest of this advisory assumes a good
    understanding of NIS+ permission controls.

    AUSCERT has received information that under some installations of NIS+
    the permissions on the NIS+ passwd table are left in an unsecure state.

    This vulnerability is known to exist in NIS+ installations initially
    created on Solaris 2.5 servers.  Similar vulnerabilities in NIS+
    configurations may also exist in previous versions of Solaris 2.

2.  Impact

    Any user with login access to a client or server that uses NIS+ for
    authentication may gain root privileges.

3.  Workarounds

    NIS+ uses an access control mechanism for granting access to NIS+ tables
    which is similar (but not identical) to that used by the standard Unix
    file system.  NIS+ tables are assigned permissions for the NIS+ user
    categories nobody, owner, group and world.  NIS+ also has permissions
    associated with columns and individual entries in NIS+ tables.

    Under some installations of NIS+ the permissions of the NIS+ passwd
    table and its columns are left in an unsecure state.  These permissions
    can be viewed using niscat(1).  

    To check the permissions on the NIS+ passwd table, sites can use:

    # niscat -o passwd.org_dir

    This should produce output similar to:

Object Name   : passwd
Owner         : myhost.mydomain.org.
Group         : admin.mydomain.org.
Domain        : org_dir.mydomain.org.
Access Rights : ----rmcdrmcd----  
Time to Live  : 12:0:0
Object Type   : TABLE
Table Type          : passwd_tbl
Number of Columns   : 8
Character Separator : :
Search Path         :
Columns             :
        [0]     Name          : name
                Attributes    : (SEARCHABLE, TEXTUAL DATA, CASE SENSITIVE)
                Access Rights : r---------------
        [1]     Name          : passwd
                Attributes    : (TEXTUAL DATA)
                Access Rights : -----m----------
        [2]     Name          : uid
                Attributes    : (SEARCHABLE, TEXTUAL DATA, CASE SENSITIVE)
                Access Rights : r---------------
        [3]     Name          : gid
                Attributes    : (TEXTUAL DATA)
                Access Rights : r---------------
        [4]     Name          : gcos
                Attributes    : (TEXTUAL DATA)
                Access Rights : r---------------
        [5]     Name          : home
                Attributes    : (TEXTUAL DATA)
                Access Rights : r---------------
        [6]     Name          : shell
                Attributes    : (TEXTUAL DATA)
                Access Rights : r---------------
        [7]     Name          : shadow
                Attributes    : (TEXTUAL DATA)
                Access Rights : ----------------

    This output shows two types of access rights associated with the NIS+
    passwd table.  First, the default access rights for the table, which are
    given at the start of the output (----rmcdrmcd----).  Second,  the access
    rights associated with each column.

    In particular, sites should check the access rights on the columns of
    the NIS+ passwd table.  It should be noted that it appears that individual
    entries of the passwd table are owned by individual users.  The above
    access rights do not allow a user to modify any part of their passwd
    table entry besides their own passwd field.  For many environments this is
    acceptable.  For sites who wish users to be able to change their shells
    or gcos information those columns may have the (m)odify bit set for owner.
    Other than this, the access rights on columns should appear as above.

    Any additional access rights on the table or its columns besides those
    shown above may allow a user to gain additional privileges, including
    possibly root.  Sites should completely understand the ramifications if
    they allow additional access rights.

    Sites may set the access rights on the NIS+ passwd table, as shown in the
    above output, by issuing the following commands as root on the master NIS+
    server.

    To set the default access rights for the NIS+ passwd table:

	# nischmod na-rmcd,og+rmcd passwd.org_dir

    To set the column access rights on the NIS+ passwd table:

	# nistbladm -u name=na-rmcd,n=r passwd.org_dir
	# nistbladm -u passwd=na-rmcd,o=m passwd.org_dir
	# nistbladm -u uid=na-rmcd,n=r passwd.org_dir
	# nistbladm -u gid=na-rmcd,n=r passwd.org_dir
	# nistbladm -u gcos=na-rmcd,n=r passwd.org_dir
	# nistbladm -u home=na-rmcd,n=r passwd.org_dir
	# nistbladm -u shell=na-rmcd,n=r passwd.org_dir
	# nistbladm -u shadow=na-rmcd passwd.org_dir

    After making any changes in access rights, AUSCERT recommends that sites
    verify the changes they have made using niscat(1), as shown previously.

    Sites that have replica NIS+ servers may use nisping(1m) to propagate
    the changes to the replica servers in a timely manner.

4.  Additional measures

    AUSCERT recommends that sites take this opportunity to ensure that all
    NIS+ tables have access rights in accordance with the local site security
    policy.  This also includes checking access rights on all the columns
    and entries of the NIS+ tables in addition to the default access rights
    of the tables themselves.

- -----------------------------------------------------------------------------
AUSCERT wishes to thank Ivan Angus and David Clarke of ANU for reporting this
vulnerability and for their advice in the preparation of this advisory.
AUSCERT also acknowledges Marek Krawus of UQ,  Reinhard Uebel and Mark
McPherson of QTAC for their assistance.
- -----------------------------------------------------------------------------

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 4477
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
c/- Prentice Centre
The University of Queensland
Brisbane
Qld.  4072.
AUSTRALIA

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i
Comment: Finger pgp@ftp.auscert.org.au to retrieve AUSCERT's public key

iQCVAwUBMaB9dSh9+71yA2DNAQFW5wP9FmRtDwhGOy/0j6tV43zyQ/FjpzRFe3Yv
6Nm37T/iBM1tR6rA0Gbb3Y2idi18lu/zuOFlpsrkccPnT0znAsEFCDkaZ3GjOyLf
QExXdRJ1e1Azbsdr9GD1gJ+Ch82jxrlcbUlGcqsvdu7r6re9HMSa5uVLCsXRVhRz
M4t+L3kbDF8=
=skmB
-----END PGP SIGNATURE-----

