[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SunOS "chkey" security vulnerability
- Subject: SunOS "chkey" security vulnerability
- Date: Tue, 17 Jun 1997 10:45:37 -0700
- Delivery-date: Tue, 17 Jun 1997 10:48:39 -0700
The attached CIAC advisory describes a security problem in the Solaris
"chkey" command. This problem allows users already having accounts, to
gain root access.
We've patched most of the vulnerable hosts, using a patch supplied by
sun.
[This notice is a part of OAC's efforts to keep the campus informed of
potential computer security liabilities. Please send any questions or
concerns to us at DCS@UCI.EDU]
__________________________________________________________
The U.S. Department of Energy
Computer Incident Advisory Capability
___ __ __ _ ___
/ | /_\ /
\___ __|__ / \ \___
__________________________________________________________
INFORMATION BULLETIN
May 22, 1997 17:00 GMT Number H-59
===========================================================================
AA-97.18 AUSCERT Advisory
Solaris 2.x chkey Buffer Overflow Vulnerability
22 May 1997
Last Revised:
-
-----------------------------------------------------------------------------
AUSCERT has received information that a vulnerability exists in the
chkey(1) program under Solaris 2.x.
This vulnerability may allow local users to gain root privileges.
Exploit information involving this vulnerability has been made publicly
available.
Currently there are no vendor patches available that address this
vulnerability. 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 a vulnerability exists in the
Solaris 2.x chkey(1) program.
chkey is used to change a user's secure RPC public key and secret key
pair.
Due to insufficient bounds checking on arguments passed to the chkey
program, it is possible to overwrite the internal data space of this
program while it is executing. As chkey has setuid root permissions,
this vulnerability may allow local users to gain root privileges.
Exploit information involving this vulnerability has been made publicly
available.
chkey under Solaris 2.x is located by default in /usr/bin/.
Sun Microsystems is aware of this problem and is currently
investigating it.
2. Impact
Local users may gain root privileges.
3. Workarounds/Solution
AUSCERT recommends that sites limit the possible exploitation of this
vulnerability by immediately applying the workaround given in Section
3.1.
To maintain the functionality of chkey, AUSCERT recommends applying
the workaround given in Section 3.2.
Currently there are no vendor patches available that address this
vulnerability. AUSCERT recommends that official vendor patches be
installed when they are made available.
3.1 Remove setuid and non-root execute permissions
To prevent the exploitation of the vulnerability described in this
advisory, AUSCERT recommends that the setuid permissions be removed
from the chkey program immediately. As the chkey program will no
longer work for non-root users, it is recommended that the execute
permissions for them also be removed.
# ls -l /usr/bin/chkey
-r-sr-xr-x 1 root sys 19608 Oct 25 1995 /usr/bin/chkey
# chmod 500 /usr/bin/chkey
# ls -l /usr/bin/chkey
-r-x------ 1 root sys 19608 Oct 25 1995 /usr/bin/chkey
For those sites which require the chkey functionality, AUSCERT
recommends applying the workaround given in Section 3.2.
3.2 Install wrapper
AUSCERT has developed a wrapper to help prevent programs from being
exploited using the vulnerability described in this advisory. Sites
which have a C compiler can obtain the source, compile and install
the wrapper as described in Section 3.2.1. For sites without a C
compiler, AUSCERT has made pre-compiled binaries available for Solaris
2.4, 2.5 and 2.5.1 (Section 3.2.2).
3.2.1 Installing the wrapper from source
The source for the wrapper, including installation instructions, can
be obtained from:
ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper/
overflow_wrapper.c
This wrapper replaces the chkey program and checks the length of the
command line arguments which are passed to it. If an argument exceeds
a certain predefined value (MAXARGLEN), the wrapper exits without
executing the chkey command. The wrapper program can also be
configured to syslog any failed attempts to execute chkey with
arguments exceeding MAXARGLEN. For further instructions on using this
wrapper, please read the comments at the top of overflow_wrapper.c.
When compiling overflow_wrapper.c for use with chkey, AUSCERT recommends
defining MAXARGLEN to be 32.
The MD5 checksum for the current version of overflow_wrapper.c can be
retrieved from:
ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper/CHECKSUM
The CHECKSUM file has been digitally signed using the AUSCERT PGP key.
3.2.2 Installing the wrapper binaries
Pre-compiled wrapper binaries are provided for sites that wish to
install the wrapper but do not have a C compiler available. AUSCERT
has compiled the wrapper on Solaris 2.4, 2.5 and 2.5.1. The following
compile time options have been used to the create the binaries:
REAL_PROG='"/usr/bin/chkey.real"'
MAXARGLEN=32
SYSLOG
More information on these options can be found in Section 3.2.1 and
in the overflow_wrapper.c source code.
The pre-compiled binaries for the wrapper program can be retrieved
from:
ftp://ftp.auscert.org.au/pub/auscert/tools/AA-97.18-chkey_wrapper.tar.Z
The MD5 checksum for AA-97.18-chkey_wrapper.tar.Z is:
MD5 (AA-97.18-chkey_wrapper.tar.Z) = bafd43c2357156595d65c7ed38fd6aeb
AA-97.18-chkey_wrapper.tar.Z contains a README file with installation
instructions, as well as pre-compiled binaries for /usr/bin/chkey
under Solaris 2.4, 2.5 and 2.5.1. The binaries have been linked
statically so they are larger than the default chkey binary.
Sites are encouraged to carefully read the installation notes in the
README file before installation.
===========================================================================