From owner-doc-jp@jp.freebsd.org  Wed Nov  1 06:25:50 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id GAA99532;
	Wed, 1 Nov 2000 06:25:50 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from eos.ocn.ne.jp (eos.ocn.ne.jp [210.190.142.171])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id GAA99527
	for <doc-jp@jp.freebsd.org>; Wed, 1 Nov 2000 06:25:50 +0900 (JST)
	(envelope-from hrs@eos.ocn.ne.jp)
Received: from mail.hrslab.yi.org (p0189-ip01funabasi.chiba.ocn.ne.jp [211.123.225.189])
	by eos.ocn.ne.jp (8.9.1a/OCN/) with ESMTP id GAA12759
	for <doc-jp@jp.freebsd.org>; Wed, 1 Nov 2000 06:26:49 +0900 (JST)
Message-Id: <200010312126.GAA12759@eos.ocn.ne.jp>
Received: from localhost (alph.hrslab.yi.org [192.168.0.10])
	by mail.hrslab.yi.org (8.9.3/3.7W/DomainMaster) with ESMTP id GAA91206
	for <doc-jp@jp.freebsd.org>; Wed, 1 Nov 2000 06:06:24 +0900 (JST)
	(envelope-from hrs@eos.ocn.ne.jp)
To: doc-jp@jp.freebsd.org
In-Reply-To: <20001030231153.B618B37B4CF@hub.freebsd.org>
References: <20001030231153.B618B37B4CF@hub.freebsd.org>
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Wed_Nov__1_06:01:23_2000_809)--"
Content-Transfer-Encoding: 7bit
X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Date: Wed, 01 Nov 2000 06:06:23 +0900
From: Hiroki Sato <hrs@eos.ocn.ne.jp>
X-Dispatcher: imput version 20000228(IM140)
Lines: 193
Reply-To: doc-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: doc-jp 7774
Subject: [doc-jp 7774] Re: ANNOUNCE: FreeBSD Security Advisory: FreeBSD-SA-00:58.chpass
Errors-To: owner-doc-jp@jp.freebsd.org
Sender: owner-doc-jp@jp.freebsd.org
X-Originator: hrs@eos.ocn.ne.jp

----Next_Part(Wed_Nov__1_06:01:23_2000_809)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B:4F#!wEl5~M}2JBg3X$G$9!#(B

 00:58 $B$NK]Lu$G$9!#(B
 $B;H$C$F$$$kMQ8l$,$$$^$$$A$J46$8$J$N$G!"(B
 $BB>$KNI$$0F$,$"$l$P;XE&$/$@$5$$!#(B


----Next_Part(Wed_Nov__1_06:01:23_2000_809)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Disposition: attachment; filename="00:58"
Content-Transfer-Encoding: 7bit

 $B$3$N%a!<%k$O(B, announce-jp $B$KN.$l$?(B

  Subject: ANNOUNCE: FreeBSD Security Advisory: FreeBSD-SA-00:58.chpass
  From: FreeBSD Security Advisories <security-advisories@freebsd.org>
  Date: Mon, 30 Oct 2000 15:11:53 -0800 (PST)
  Message-Id: <20001030231153.B618B37B4CF@hub.freebsd.org>
  X-Sequence: announce-jp 576

 $B$rF|K\8lLu$7$?$b$N$G$9(B. 

 $B$3$N4+9p$NCf$G>R2p$5$l$F$$$k(B WWW $B%5%$%H(B http://www.FreeBSD.org/ $B$*$h$S(B
 FTP $B%5%$%H(B ftp://ftp.FreeBSD.org/ $B$K$O(B, $BF|K\$N%_%i!<%5%$%H$,B8:_$7$^$9(B.
 $B%_%i!<%5%$%H$rMxMQ$9$k$K$O(B,
 http://www.FreeBSD.org/ $B$r(B http://www.jp.FreeBSD.org/www.freebsd.org/ $B$K(B,
 ftp://ftp.FreeBSD.org/ $B$r(B ftp://ftp.jp.FreeBSD.org/ $B$K(B,
 $B$=$l$>$lCV$-49$($F$/$@$5$$(B.

 $B%M%C%H%o!<%/$N:.;($r4KOB$9$k$?$a(B, $B$^$:$O%_%i!<%5%$%H$NMxMQ$r(B
 $B9MN8$9$k$h$&$*4j$$$7$^$9(B.  $B%_%i!<%5%$%H$K4X$9$k>\:Y$O(B

  http://www.FreeBSD.org/handbook/mirror.html ($B1QJ8(B)
  http://www.FreeBSD.org/ja/handbook/mirror.html ($BF|K\8lLu(B)

 $B$K(B, $B$^$?(B, $B2a5n$NF|K\8lHG%;%-%e%j%F%#4+9p$O(B

  http://www.FreeBSD.org/ja/security/

 $B$K$^$H$a$i$l$F$$$^$9(B.

 $B86J8$O(B PGP $B=pL>$5$l$F$$$^$9$,(B, $B$3$NF|K\8lLu$O(B PGP $B=pL>$5$l$F$$$^$;$s(B. 
 $B%Q%C%AEy$NFbMF$,2~cb$5$l$F$$$J$$$3$H$r3NG'$9$k$?$a$K(B PGP $B$N%A%'%C%/$r(B
 $B9T$J$&$K$O(B, $B86J8$r;2>H$7$F$/$@$5$$(B. 

 $BF|K\8lLu$O(B FreeBSD $BF|K\8l%I%-%e%a%s%F!<%7%g%s%W%m%8%'%/%H(B (doc-jp) $B$,;29M$N(B
 $B$?$a$KDs6!$9$k$b$N$G(B, doc-jp $B$O(B $B$=$NFbMF$K$D$$$F$$$+$J$kJ]>Z$b$$$?$7$^$;$s(B.
 $BF|K\8lLu$K$D$$$F$N$*Ld$$9g$o$;$O(B doc-jp@jp.FreeBSD.org $B$^$G$*4j$$$7$^$9(B.

--($B$3$3$+$i(B)

=============================================================================
FreeBSD-SA-00:58                                           Security Advisory
                                                                FreeBSD, Inc.

$B%H%T%C%/(B:	chpass family contains local root vulnerability

$BJ,N`(B:		core
$B%b%8%e!<%k(B:	chfn/chpass/chsh/ypchfn/ypchpass/ypchsh/passwd
$B9pCNF|(B:		2000-10-30
$B%/%l%8%C%H(B:	$B$3$NLdBj$OFbIt%;%-%e%j%F%#4F::Cf$K=$@5$5$l$^$7$?(B.
		$B<eE@$O(B caddis <caddis@DISSENSION.NET> $B$N;XE&$K$h$k$b$N$G$9(B.
$B1F6AHO0O(B:	FreeBSD 3.x ($B$9$Y$F$N%j%j!<%9(B), FreeBSD 4.0-RELEASE,
		$B=$@5F|A0$N(B FreeBSD 4.0-STABLE
$B=$@5F|(B:		2000/07/20 (FreeBSD 4.0-STABLE)
		2000/10/04 (FreeBSD 3.5.1-STABLE)
FreeBSD $B$K8GM-$+(B:	NO

I.   $BGX7J(B - Background

ch{fn,pass,sh} are utilities for changing user "finger" information,
passwords, and login shell, respectively. The yp* variants perform the
analogous changes on a NIS account.

chfn, chpass, chsh $B$O%f!<%6$N(B finger $B>pJs(B, $B%Q%9%o!<%I(B, $B%m%0%$%s%7%'%k$r(B
$BJQ99$9$k$?$a$N%f!<%F%#%j%F%#$G$9(B.  $B$^$?(B, yp* $B$H$$$&7A$N$b$N(B ($BLuCm(B: ypchfn
$B$J$I(B) $B$O(B, NIS $B%"%+%&%s%H$KBP$7$FF1MM$N5!G=$rDs6!$7$^$9(B.

II.  $BLdBj$N>\:Y(B - Problem Description

A "format string vulnerability" was discovered in code used by the
vipw utility during an internal FreeBSD code audit in July 2000. The
vipw utility does not run with increased privileges and so it was
believed at the time that it did not represent a security
vulnerability. However it was not realised that this code is also
shared with other utilities -- namely chfn, chpass, chsh, ypchfn,
ypchpass, ypchsh and passwd -- which do in fact run setuid root.

2000 $BG/(B 7 $B7n$K9T$J$o$l$?(B FreeBSD $BFbIt%3!<%I$N%;%-%e%j%F%#4F::$G(B,
vipw $B%f!<%F%#%j%F%#$K;H$o$l$F$$$k%3!<%ICf$K!V=q<0;XDjJ8;zNs$K5/0x$9$k(B
$B%;%-%e%j%F%#>e$N<eE@!W$,H/8+$5$l$^$7$?(B.  vipw $B%f!<%F%#%j%F%#$O(B
$B9b$$8"8B$G<B9T$5$l$J$$$?$a(B, $B$=$N;~E@$G$O%;%-%e%j%F%#>e$N<eE@$K$O(B
$B$J$i$J$$$@$m$&$H9M$($i$l$F$$$^$7$?$,(B, $B$3$N%3!<%I$,B>$N%f!<%F%#%j%F%#(B,
chfn, chpass, chsh, ypchfn, ypchpass, ypchsh $B$*$h$S(B passwd $B$N4V$G(B
$B6&M-$5$l$F$$$k$H$$$&$3$H$,8+Mn$H$5$l$F$$$^$7$?(B.  $B$3$l$i$N(B
$B%f!<%F%#%j%F%#$O(B root $B%f!<%6$G(B setuid $B$5$l$F<B9T$5$l$^$9(B.

Therefore, the problem may be exploited by unprivileged local users to
gain root access to the local machine.

$B$7$?$,$C$F$3$N%;%-%e%j%F%#>e$N<eE@$O(B, $B9b$$8"8B$r;}$?$J$$(B
$B%m!<%+%k%f!<%6$K$h$C$F(B, $B%m!<%+%k%^%7%s>e$N(B root $B%"%/%;%9$rF@$k$?$a$K(B
$B0-MQ$5$l$k4m81@-$,$"$j$^$9(B.

All versions of FreeBSD prior to the correction date including 4.0 and
3.5.1 are vulnerable to this problem, but it was fixed in the 4.x
branch prior to the release of FreeBSD 4.1.

FreeBSD 4.0 $B$H(B 3.5.1 $B$r4^$`(B, $B=$@5F|0JA0$N$9$Y$F$N%P!<%8%g%s$N(B
FreeBSD $B$,$3$N%;%-%e%j%F%#>e$N<eE@$N1F6A$r<u$1$^$9(B.
$BLdBjE@$N=$@5$O(B FreeBSD 4.1 $B$N8x3+A0$N(B 4.x $B%V%i%s%A$G9T$J$o$l$^$7$?(B.

III. $B1F6AHO0O(B - Impact

Local users can obtain root privileges on the local machine.

$B%m!<%+%k%f!<%6$O%m!<%+%k%^%7%s$N(B root $B8"8B$rF@$k$3$H$,$G$-$^$9(B.

IV.  $B2sHrJ}K!(B - Workaround

Remove the setuid bit on the following utilities. This has the
side-effect that non-root users cannot change their finger
information, passwords, or login shells.

$B0J2<$N%f!<%F%#%j%F%#$+$i(B, setuid $B%S%C%H$r:o=|$7$F$/$@$5$$(B.
$B$3$l$K$h$j(B, root $B%f!<%60J30$N%f!<%6$,(B finger $B>pJs$d%Q%9%o!<%I(B,
$B%m%0%$%s%7%'%k$rJQ99$G$-$J$/$J$k$H$$$&I{:nMQ$,$"$j$^$9(B.

# chflags noschg /usr/bin/chfn /usr/bin/chpass /usr/bin/chsh
# chmod u-s /usr/bin/chfn /usr/bin/chpass /usr/bin/chsh
# chflags noschg /usr/bin/ypchfn /usr/bin/ypchpass /usr/bin/ypchsh
# chmod u-s /usr/bin/ypchfn /usr/bin/ypchpass /usr/bin/ypchsh
# chflags noschg /usr/bin/passwd
# chmod u-s /usr/bin/passwd

V.   $B2r7h:v(B - Solution

One of the following:
$B<!$N$$$:$l$+$K=>$C$F$/$@$5$$(B.

1) Upgrade your vulnerable FreeBSD system to 4.1-RELEASE,
4.1.1-RELEASE, 4.1.1-STABLE or 3.5.1-STABLE after the respective
correction dates.
1) $B<eE@$r;}$C$?(B FreeBSD $B%7%9%F%`$r(B, $B$=$l$>$l$N=$@5F|0J9_$N(B
   4.1-RELEASE, 4.1.1-STABLE $B$b$7$/$O(B 3.5.1-STABLE $B$K%"%C%W%0%l!<%I$7$^$9(B.

2) Apply the patch below and recompile the respective files:
2) $B2<$N=$@5%Q%C%A$rE,MQ$7(B, $B3F%U%!%$%k$r:F9=C[$7$F$/$@$5$$(B.

Either save this advisory to a file, or download the patch and
detached PGP signature from the following locations, and verify the
signature using your PGP utility.

$B$3$N4+9p$r%U%!%$%k$KJ]B8$9$k$+(B, $B=$@5%Q%C%A$H(B PGP $B=pL>$r0J2<$N>l=j$+$i(B
$B%@%&%s%m!<%I$7(B, PGP $B%f!<%F%#%j%F%#$r;H$C$F=pL>$r3NG'$7$^$9(B.

ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-00:58/vipw.patch
ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-00:58/vipw.patch.asc

Execute the following commands as root:
root $B8"8B$G<!$N%3%^%s%I$r<B9T$7$^$9(B.

# cd /usr/src/usr.sbin/vipw
# patch -p < /path/to/patch_or_advisory
# make depend && make all install
# cd /usr/src/usr.bin/chpass/
# make depend && make all install
# cd /usr/src/usr.bin/passwd/
# make depend && make all install

Patch for vulnerable systems:
$B<eE@$r;}$C$?%7%9%F%`MQ$N=$@5%Q%C%A(B:

    --- pw_util.c   1999/08/28 01:20:31     1.17
    +++ pw_util.c   2000/07/12 00:49:40     1.18
    @@ -250,7 +250,7 @@
            extern int _use_yp;
     #endif /* YP */
            if (err)
    -               warn(name);
    +               warn("%s", name);
     #ifdef YP
            if (_use_yp)
                    warnx("NIS information unchanged");


$hrs: FreeBSD-SA/00:58,v 1.1 2000/10/31 21:00:53 hrs Exp $

----Next_Part(Wed_Nov__1_06:01:23_2000_809)----
