[ale] SECURITY HOLE in 2.2.x kernels

Bob bob at cavu.com
Thu Jun 8 03:58:15 EDT 2000


There is a severe security hole in the Linux kernel in version 2.2.x,
where x < 16pre6.  Linux 2.0.x and earlier is not affected.   This was
reported on Bugtraq within the hour.  I am including the appropriate
sections of this Bugtraq message.  I received this email directly from
Bugtraq and have verified that it is very unlikely to have been spoofed.

Bob Toxen
bob at cavu.com
http://www.cavu.com
Fly-By-Day Consulting, Inc.       "Don't go with a fly-by-night outfit!"
Quality Linux & UNIX software consulting since 1990.
No Microsoft programs were used in the creation or distribution of this
message.
----------------- Bugtraq excerpts follow ----------------------

Date:     Thu, 8 Jun 2000 00:01:04 -0700
From: Automatic digest processor <LISTSERV at LISTS.SECURITYFOCUS.COM>
To: ale at ale.org
Subject:  BUGTRAQ Digest - 6 Jun 2000 to 7 Jun 2000 (#2000-126)
To: Recipients of BUGTRAQ digests <BUGTRAQ at LISTS.SECURITYFOCUS.COM>

There are 8 messages totalling 862 lines in this issue.

Topics of the day:

  1. Sendmail Workaround for Linux Capabilities Bug
  4. local root on linux 2.2.15
  5. Local root vulnerability in most used Linux kernels
----------------------------------------------------------------------
Date:    Wed, 7 Jun 2000 18:42:34 -0700
From:    Sendmail Security <sendmail-security at SENDMAIL.ORG>
To: ale at ale.org
Subject: Sendmail Workaround for Linux Capabilities Bug

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

		SENDMAIL SECURITY TEAM ADVISORY

	Sendmail Workaround for Linux Capabilities Bug

The Sendmail Consortium and Sendmail, Inc. has been informed of a
serious problem in the Linux kernel that can be used to get root
access.  This is not a sendmail security problem, although sendmail
is one of the vectors for this attack.

PROBLEM

	There is a bug in the Linux kernel capability model for versions
	through 2.2.15 that allows local users to get root.  Sendmail is
	one of the programs that can be attacked this way.  This problem
	may occur in other capabilities-based kernels.

SOLUTION

	The correct fix is to update your Linux kernel to version
	2.2.16.  This is the only way to ensure that other programs
	running on Linux cannot be attacked by this bug.

WORKAROUND

	Sendmail 8.10.2 has added a check to see if the kernel has
	this bug, and if so will refuse to run.  This version also
	does more detailed checks on certain system calls, notably
	setuid(2), to detect other possible attacks.  Although there
	are no known attacks, this version is strongly recommended,
	whether or not you have a vulnerable kernel.

	Sendmail 8.10.2 can be obtained from:

	ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.10.2.tar.gz
	ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.10.2.tar.Z
	ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.10.2.tar.sig

        and has MD5 signatures:

	acb8b6f50869a058a9baaa4fb4692c4b sendmail.8.10.2.tar.Z
	00705e5ca3412604cebd052e0d7aefcd sendmail.8.10.2.tar.gz
	92dca37fb68a2a44f02c292656c123b6 sendmail.8.10.2.tar.sig

	You only need one of the first two files (either the gzip'ed
	version or the compressed version).  The .sig file is a PGP
	signatures of the tar file (after uncompressing it).  It is
	signed with the Sendmail Signing Key/2000, available on the web
	site (http://www.sendmail.org/) or on the public key servers.

	Note however that installing this sendmail patch does not
	fully protect you from attack.  Other programs are probably
	vulnerable.

ACKNOWLEDGEMENTS

	Several people contributed to this advisory.  Wojciech Purczynski
	of Elzab Soft first identified the problem.  Alan Cox verified
	and patched the Linux kernel bug.  Gregory Neil Shapiro and other
	members of the Sendmail Consortium helped identify the problem
	and produce the sendmail workaround.

DETAILS OF THE VULNERABILITY

	The problem lies in the setcap(2) call, which is not documented
	on most Linux-based systems (we think there might be a man page
	on Mandrake).  This call, based on the unratified Posix 1e draft,
	attempts to break down root permissions into a series of
	capabilities.  Normally root has all capabilities and normal
	users have none of the capabilities.

	One such capability is the ability of a process to do an
	arbitrary setuid(2) call.  As documented in ISO/IEC 9945-1
	(ANSI/IEEE Std 1003.1) POSIX Part 1:

		4.2.2.2 Description
		...
		   If {_POSIX_SAVED_IDS} is defined:

		   (1) If the process has appropriate privileges, the
		       setuid() function sets the real user ID, effective
		       user ID, and the saved set-user-ID to uid.

		   (2) If the process does not have the appropriate
		       privileges, but uid is equal to the real user ID
		       or the saved set-user-ID, the setuid() function
		       sets the effective user ID to uid; the real user
		       ID and saved set-user-ID remain unchanged by this
		       function call.

	The CAP_SETUID capability represents the "appropriate privileges".

	Normally this would not be an issue, since a setuid root program
	would simply have capability reinstated.  However, Linux has
	an added capability CAP_SETPCAP that controls the ability of a
	process to inherit capabilities; this capability does affect
	setuid programs.  It is possible to set the capabilities such
	that a setuid program does not have "appropriate privileges."
	The effect of this is that a root program cannot fully give up
	its root privileges (since the saved set-user-ID cannot be
	reset).

	Note that checking the return value from setuid() is insufficient;
	the setuid(getuid()) succeeds even when the process does not have
	"appropriate privileges."

	The sendmail patch attempts a setuid(0) after a setuid(getuid());
	under normal circumstances this should fail (unless of course
	the real uid is root).  If this setuid(0) succeeds, then the
	kernel has failed to properly give up permissions and sendmail
	will refuse to continue running.

	This problem can, of course, appear in any setuid root program
	that attempts to cede special permissions.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0 for non-commercial use
Charset: noconv

iQCVAwUBOT73YsApykAW9MzpAQExvgP+MjRKFw8IGCmzIdODUF6mIQ18/TETHtHb
AE7qUZs+0NBYhceF7Qn+UggKF53bBBc1gqvBmyqkJ8MFgEWNcx2cQawTxDU2G9wi
7H95ffC9KxsVcO9CNU/1EmezLzJbQxAdgNNheHQ3MYVIBY32Bfdd3bO3oJ4uyXGd
8UqMMIAkB3U=
=E2ZI
-----END PGP SIGNATURE-----

=============================================================================

Date:    Thu, 8 Jun 2000 00:38:14 +0200
From:    Peter van Dijk <petervd at VUURWERK.NL>
To: ale at ale.org
Subject: local root on linux 2.2.15

--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

I do not have complete info right now, but here's the scoop:
Local users can gain root thru a _kernel_ bug in linux 2.2.15 and some
earlier versions. This is fixed in 2.2.16pre6. Linux 2.0.x is not
vulnerable, I do not know of any other vulnerable OSes.

The bug is that is it somehow possible to exec sendmail without the
CAP_SETUID priv, which makes the setuid() call that sendmail eventually
does to drop privs, fail. Big chunks of code that were never meant to run
as root then do run as root, which is ofcourse easily exploitable then.

This is just about all the info I have, I do not have the exploit but I
know that some black hats do have it. A couple of boxes already got
completely trashed after being rooted through this hole, which is why I am
making this public right now.

I did not discover this bug, I only extrapolated from the small info I had:
'it has to do with capsuid' 'sendmail is vulnerable, crond is not'. Some
reading of the kernel source then suggested the above to me, which has been
confirmed by a more knowledgeable source.

Greetz, Peter.
--=20
petervd at vuurwerk.nl - Peter van Dijk [student:developer:madly in love]

--vkogqOf2sHV7VnPd
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE5Ps7VbGgPAjHkJggRATM1AJ4gaOrqmDm/RUl99oGRwmkkUhBTpgCfaiu0
kluDyiPjWkyJNtWjh0IWxHE=
=XZ5/
-----END PGP SIGNATURE-----

--vkogqOf2sHV7VnPd--

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

Date:    Thu, 8 Jun 2000 00:13:18 +0200
From:    Gerrie <gerrie at HIT2000.ORG>
To: ale at ale.org
Subject: Local root vulnerability in most used Linux kernels

There is a zeroday exploit for kernel in hands of scriptkiddies.

After they rooted locally 2 system which I've intrest and did dd
if=/dev/zero of=/dev/hda1 &
on both, I spended 7 hours to finding fragments (we really need easies tools
LDE with GUI block search capabilities)
This with help of Peter we came to the following conclusion.

This exploits gives them local root.
It works -so far investigated- on

Linux 2.2.15
Linux 2.2.14-5.0 (RedHat 6.2)
Not vulnerable 2.2.0 Kernels, 2.2.16pre6 Kernels and Freebsd 4.0
2.0.x linux kernels doesn't have capabilities, and are probally not
vulnerable

In the linux kernel there are capabilities that gives restritions on
processes.
A process -like sendmail or httpd- can do his job as root and after he's
finished all capabilities as root are dropped.

Someone succeeded in calling CAP_SETUID priv, Sendmail cann't drop root  to
normal user after that.
Because Sendmail isn't made to run as root, the rest of sendmail is easy to
misabuse.

The bug in sendmail is only avaible when sendmail *probally* doesn't checks
if the dropping of privs succeeded.

Special thanx to Peter van Dijk for his great -major part- analysis.

gtx,
Gerrie Mansur
HIT2000 Information security
www.hit2000.org
www.hit2000.nl

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

End of BUGTRAQ Digest - 6 Jun 2000 to 7 Jun 2000 (#2000-126)
************************************************************
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list