exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

sa96-15

sa96-15
Posted Sep 23, 1999

security compromise from ppp

systems | freebsd
SHA-256 | 4c1c149a1b893df58213b7e287ca24c7f49106ee1a793540c44e027c2e4531dd

sa96-15

Change Mirror Download
=============================================================================
FreeBSD-SA-96:15 Security Advisory
FreeBSD, Inc.

Topic: security compromise from ppp

Category: core
Module: ppp
Announced: 1996-06-25
Affects: FreeBSD 2.0.5, 2.1, 2.1-stable, and 2.2-current
Corrected: 2.1-stable and 2.2-current as of 1996-06-10
FreeBSD only: unknown

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

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

I. Background

FreeBSD ships a userland ppp program that can be used by users
to set up ppp connections.
This program is also known as ijppp.
The ppp program has a vulnerability that allows any user to run
commands under root privileges.

II. Problem Description

The ppp program does not properly manage user privileges, allowing
users to run any program with root privileges.

III. Impact

This vulnerability can only be exploited by users with a valid
account on the local system to easily obtain superuser access.

IV. Workaround

One may simply disable the setuid bit on all copies of the ppp
program. This will close the vulnerability but will only allow
the superuser to set up ppp connections.

As root, execute the commands:

# chmod 555 /usr/sbin/ppp

then verify that the setuid permissions of the files have been
removed. The permissions array should read "-r-xr-xr-x" as
shown here:

# ls -l /usr/sbin/ppp
-r-xr-xr-x 1 root bin 86016 Nov 16 1995 /usr/sbin/ppp

V. Solution

Patches are available which eliminate this vulnerability.
The following patch should be applied to the system sources and
ppp should be rebuilt and reinstalled. The first patch is against
the FreeBSD 2.1 and FreeBSD-stable source tree. The second patch
is for FreeBSD-current (version before 1996-06-10).

Apply the patch, then (being superuser):
# cd /usr/src/usr.sbin/ppp
# make depend
# make all
# make install

Index: command.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ppp/command.c,v
retrieving revision 1.5.4.3
retrieving revision 1.5.4.4
diff -u -r1.5.4.3 -r1.5.4.4
--- command.c 1996/02/05 17:02:52 1.5.4.3
+++ command.c 1996/06/10 09:41:49 1.5.4.4
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.5.4.3 1996/02/05 17:02:52 dfr Exp $
+ * $Id: command.c,v 1.5.4.4 1996/06/10 09:41:49 ache Exp $
*
*/
#include <sys/types.h>
@@ -187,9 +187,14 @@
* We are running setuid, we should change to
* real user for avoiding security problems.
*/
- setgid( getgid() );
- setuid( getuid() );
-
+ if (setgid(getgid()) < 0) {
+ perror("setgid");
+ exit(1);
+ }
+ if (setuid(getuid()) < 0) {
+ perror("setuid");
+ exit(1);
+ }
TtyOldMode();
if(argc > 0)
execvp(argv[0], argv);
Index: chat.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ppp/chat.c,v
retrieving revision 1.4.4.1
retrieving revision 1.4.4.2
diff -u -r1.4.4.1 -r1.4.4.2
--- chat.c 1995/10/06 11:24:31 1.4.4.1
+++ chat.c 1996/06/10 09:41:45 1.4.4.2
@@ -18,7 +18,7 @@
* Columbus, OH 43221
* (614)451-1883
*
- * $Id: chat.c,v 1.4.4.1 1995/10/06 11:24:31 davidg Exp $
+ * $Id: chat.c,v 1.4.4.2 1996/06/10 09:41:45 ache Exp $
*
* TODO:
* o Support more UUCP compatible control sequences.
@@ -331,6 +331,15 @@
nb = open("/dev/tty", O_RDWR);
dup2(nb, 0);
LogPrintf(LOG_CHAT, "exec: %s\n", command);
+ /* switch back to original privileges */
+ if (setgid(getgid()) < 0) {
+ LogPrintf(LOG_CHAT, "setgid: %s\n", strerror(errno));
+ exit(1);
+ }
+ if (setuid(getuid()) < 0) {
+ LogPrintf(LOG_CHAT, "setuid: %s\n", strerror(errno));
+ exit(1);
+ }
pid = execvp(command, vector);
LogPrintf(LOG_CHAT, "execvp failed for (%d/%d): %s\n", pid, errno, command);
exit(127);


Patch for FreeBSd-current before 1996-06-10:


Index: command.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ppp/command.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- command.c 1996/05/11 20:48:22 1.17
+++ command.c 1996/06/09 20:40:58 1.18
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.17 1996/05/11 20:48:22 phk Exp $
+ * $Id: command.c,v 1.18 1996/06/09 20:40:58 ache Exp $
*
*/
#include <sys/types.h>
@@ -190,9 +190,14 @@
* We are running setuid, we should change to
* real user for avoiding security problems.
*/
- setgid( getgid() );
- setuid( getuid() );
-
+ if (setgid(getgid()) < 0) {
+ perror("setgid");
+ exit(1);
+ }
+ if (setuid(getuid()) < 0) {
+ perror("setuid");
+ exit(1);
+ }
TtyOldMode();
if(argc > 0)
execvp(argv[0], argv);
Index: chat.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ppp/chat.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- chat.c 1996/05/11 20:48:20 1.10
+++ chat.c 1996/06/09 20:40:56 1.11
@@ -18,7 +18,7 @@
* Columbus, OH 43221
* (614)451-1883
*
- * $Id: chat.c,v 1.10 1996/05/11 20:48:20 phk Exp $
+ * $Id: chat.c,v 1.11 1996/06/09 20:40:56 ache Exp $
*
* TODO:
* o Support more UUCP compatible control sequences.
@@ -393,6 +393,15 @@
nb = open("/dev/tty", O_RDWR);
dup2(nb, 0);
LogPrintf(LOG_CHAT_BIT, "exec: %s\n", command);
+ /* switch back to original privileges */
+ if (setgid(getgid()) < 0) {
+ LogPrintf(LOG_CHAT_BIT, "setgid: %s\n", strerror(errno));
+ exit(1);
+ }
+ if (setuid(getuid()) < 0) {
+ LogPrintf(LOG_CHAT_BIT, "setuid: %s\n", strerror(errno));
+ exit(1);
+ }
pid = execvp(command, vector);
LogPrintf(LOG_CHAT_BIT, "execvp failed for (%d/%d): %s\n", pid, errno, command);
exit(127);

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

Web Site: http://www.freebsd.org/
Confidential contacts: security-officer@freebsd.org
PGP Key: ftp://freebsd.org/pub/CERT/public_key.asc
Security notifications: security-notifications@freebsd.org
Security public discussion: security@freebsd.org

Notice: Any patches in this document may not apply cleanly due to
modifications caused by digital signature or mailer software.
Please reference the URL listed at the top of this document
for original copies of all patches if necessary.
=============================================================================

Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close