From owner-doc-jp@jp.freebsd.org  Tue Aug 21 18:44:09 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id SAA68323;
	Tue, 21 Aug 2001 18:44:09 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from sekine00.ee.noda.sut.ac.jp (sekine00.ee.noda.sut.ac.jp [133.31.107.40])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id SAA68318
	for <doc-jp@jp.freebsd.org>; Tue, 21 Aug 2001 18:44:09 +0900 (JST)
	(envelope-from hrs@eos.ocn.ne.jp)
Received: from localhost (sekine01.ee.noda.sut.ac.jp [133.31.107.43])
	by sekine00.ee.noda.sut.ac.jp (8.8.8+2.7Wbeta7/3.6W-12/10/97) with ESMTP id SAA05037
	for <doc-jp@jp.freebsd.org>; Tue, 21 Aug 2001 18:44:01 +0900 (JST)
Date: Tue, 21 Aug 2001 18:43:07 +0900 (JST)
Message-Id: <20010821.184307.74743884.hrs@eos.ocn.ne.jp>
To: doc-jp@jp.freebsd.org
From: Hiroki Sato <hrs@eos.ocn.ne.jp>
In-Reply-To: <200108202155.f7KLtvK62776@freefall.freebsd.org>
References: <200108202155.f7KLtvK62776@freefall.freebsd.org>
X-Mailer: Mew version 1.95b101 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Tue_Aug_21_18:43:07_2001_364)--"
Content-Transfer-Encoding: 7bit
Reply-To: doc-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: doc-jp 8359
Subject: [doc-jp 8359] Re: ANNOUNCE: FreeBSD Ports Security Advisory
 FreeBSD-SA-01:54.ports-telnetd
Errors-To: owner-doc-jp@jp.freebsd.org
Sender: owner-doc-jp@jp.freebsd.org
X-Originator: hrs@eos.ocn.ne.jp

----Next_Part(Tue_Aug_21_18:43:07_2001_364)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

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

 01:54 $B$G$9!#(B

--
| $B:4F#(B $B9-@8!wEl5~M}2JBg3X(B <hrs@eos.ocn.ne.jp>
|                         <hrs@FreeBSD.org> (FreeBSD Project)

----Next_Part(Tue_Aug_21_18:43:07_2001_364)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="01:54"


FreeBSD $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG(B
=============================================================================
FreeBSD-SA-01:54 (2001-08-20)
 * telnetd contains remote buffer overflow
=============================================================================

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

  Subject: ANNOUNCE: FreeBSD Ports Security Advisory FreeBSD-SA-01:54.ports-telnetd
  From: FreeBSD Security Advisories <security-advisories@FreeBSD.org>
  Date: Mon, 20 Aug 2001 14:55:57 -0700 (PDT)
  Message-Id: <200108202155.f7KLtvK62776@freefall.freebsd.org>
  X-Sequence: announce-jp 803

 $B$rF|K\8lLu$7$?$b$N$G$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=$@5%Q%C%AEy$NFbMF$,2~cb$5$l$F$$$J$$$3$H$r3NG'$9$k$?$a$K(B PGP $B=pL>$N(B
 $B%A%'%C%/$r9T$J$&$K$O(B, $B86J8$r;2>H$7$F$/$@$5$$(B. 

 $BF|K\8lLu$*$h$S(B, $B%_%i!<%5%$%HMxMQ$N>\:Y$K$D$$$F$O(B, $BJ8Kv$N!V(BA. FreeBSD
 $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG$K$D$$$F!W$r$4Mw$/$@$5$$(B.


                                     [$BK]Lu<T(B: $B:4F#(B $B9-@8(B <hrs@jp.FreeBSD.org>]
--($B$3$3$+$i(B)

=============================================================================
FreeBSD-SA-01:54                                           Security Advisory
                                                                FreeBSD, Inc.

$B%H%T%C%/(B:	telnetd contains remote buffer overflow

$BJ,N`(B:		ports
Modules:        krb5/heimdal/SSLtelnet
$B9pCNF|(B:		2001-08-20
$B%/%l%8%C%H(B:	Sebastian <scut@nb.in-berlin.de>
$B1F6AHO0O(B:	$B=$@5F|0JA0$N(B Ports Collection
$B=$@5F|(B:		2001-07-19 21:43:41 UTC (heimdal)
                2001-07-24 15:29:39 UTC (krb5)
                SSLtelnet port $B$OL$=$@5(B
FreeBSD $B$K8GM-$+(B:	NO


I.   $BGX7J(B - Background

telnetd is the server for the telnet remote virtual terminal protocol.

telnetd $B$O(B, telnet $B%j%b!<%H2>A[C<Kv%W%m%H%3%kMQ$N%5!<%P%W%m%0%i%`$G$9(B.


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

This advisory is closely related to the previously released
FreeBSD-SA-01:49.telnetd.v1.1 advisory.  That advisory pertains to the
telnetd included in the base FreeBSD system.  This advisory pertains
to optional third-party telnetd implementations found in the FreeBSD
ports collection.

$B$3$N%;%-%e%j%F%#4+9p$O(B, $B@h$K8x3+$5$l$?(B FreeBSD-SA-01:49.telnetd.v1.1 $B$H(B
$BL)@\$J4X78$,$"$j$^$9(B.  $BA02s$N4+9p$O(B FreeBSD $B%Y!<%9%7%9%F%`$K4^$^$l$k(B
telnetd $B$K4X$9$k$b$N$G$7$?$,(B, $B:#2s$O(B FreeBSD Ports Collection $B$K(B
$B4^$^$l$F$$$k%5!<%I%Q!<%F%#@=$N(B telnetd $B<BAu$K4X$9$k$b$N$H$J$C$F$$$^$9(B.

An overflowable buffer was found in the versions of telnetd included
with several ports.  These ports include:

$B0J2<$N(B port $B$K4^$^$l$k(B telnetd $B$K$O(B, $B%P%C%U%!%*!<%P%U%m!<LdBj$,(B
$BB8:_$9$k$3$H$,H=L@$7$F$$$^$9(B.

  MIT Kerberos V (security/krb5) prior to version 1.2.2_2
  Heimdal (security/heimdal) prior to version 0.4b_1
  SSLtelnet (net/SSLtelnet) - this port is not yet fixed; see below.

  $B%P!<%8%g%s(B 1.2.2_2 $B$h$jA0$N(B MIT Kerberos V (security/krb5)
  $B%P!<%8%g%s(B 0.4b_1 $B$h$jA0$N(B Heimdal (security/heimdal)
  SSLtelnet (net/SSLtelnet) - $B$3$N(B port $B$OL$=$@5$G$9(B.  $B0J2<$r$4Mw$/$@$5$$(B.

Due to incorrect bounds checking of data buffered for output to the
remote client, an attacker can cause the telnetd process to overflow
the buffer and crash, or execute arbitrary code as the user running
telnetd, usually root.  A valid user account and password is not
required to exploit this vulnerability, only the ability to connect to
a telnetd server.

$B967b<T$O%j%b!<%H%/%i%$%"%s%H$X$N=PNO%G!<%?MQ%P%C%U%!$KB8:_$9$k(B
$BIT@5$J6-3&%A%'%C%/$r0-MQ$9$k$3$H$G(B, telnetd $B%W%m%;%9$K(B
$B%P%C%U%!%*!<%P%U%m!<$rH/@8$5$;$F%/%i%C%7%e$5$;$?$j(B,
$B$"$k$$$O(B telnetd $B$r<B9T$7$F$$$k%f!<%6(B ($BDL>o(B root) $B$N8"8B$G(B
$BG$0U$N%3!<%I$rIT@5$K<B9T$9$k$3$H$,2DG=$G$9(B.  $B$3$N%;%-%e%j%F%#>e$N<eE@$O(B
telnetd $B%5!<%P$X$N%"%/%;%9$,2DG=$G$"$l$P0-MQ2DG=$G$"$j(B, $BM-8z$J(B
$B%f!<%6%"%+%&%s%H$d%Q%9%o!<%I$rI,MW$H$7$^$;$s(B.

These ports are not installed by default, nor are they "part of
FreeBSD" as such: they are part of the FreeBSD ports collection, which
contains over 5600 third-party applications in a ready-to-install
format. The ports collection shipped with FreeBSD 4.3 is vulnerable to
this problem since it was discovered after its release, but the
problems with the krb5 and heimdal ports were corrected prior to the
(forthcoming) release of FreeBSD 4.4.

$B$3$l$i$N(B port $B$O%G%U%)%k%H$G%$%s%9%H!<%k$5$l$k$b$N$G$O$J$/(B,
$B!V(BFreeBSD $B%7%9%F%`$N0lIt!W$r9=@.$9$k$b$N$G$b$"$j$^$;$s(B.
$B$=$l$i$O(B 5600 $B$r1[$($k%5!<%I%Q!<%F%#@=%"%W%j%1!<%7%g%s$,$9$0$K(B
$B%$%s%9%H!<%k$G$-$k7A$G<}$a$i$l$F$$$k(B FreeBSD Ports Collection $B$N0lIt$G$9(B.
$B%j%j!<%98e$KLdBj$,8+$D$+$C$?$?$a(B FreeBSD 4.3 $B$H$H$b$K(B
$B=P2Y$5$l$?(B Ports Collection $B$O$3$NLdBj$r4^$s$G$$$^$9$,(B,
krb5, heimdal $B$N(B port $B$O8x3+M=Dj$N(B FreeBSD 4.4 $B$N%j%j!<%9A0$K=$@5$5$l$^$7$?(B.

The SSLtelnet vulnerability has not yet been corrected: due to
divergences in the code, it is more difficult to correct the
vulnerability in that port.  This advisory will be reissued once the
vulnerability is corrected.

$B%3!<%I5,LO$,Bg$-$/<eE@$N=$@5$,:$Fq$J$?$a(B, SSLtelnet $B$N(B port $B$K4^$^$l$k(B
$B%;%-%e%j%F%#>e$N<eE@$O$^$@=$@5$5$l$F$$$^$;$s(B.  $B$=$N$?$a(B,
$B$3$N%;%-%e%j%F%#4+9p$O(B, $B<eE@$,=$@5$5$l<!Bh:FH/9T$5$l$kM=Dj$G$9(B.


III. $B1F6AHO0O(B - Impact

Remote users can cause arbitrary code to be executed as the user
running telnetd, usually root.

$B%j%b!<%H%f!<%6$O(B telnetd $B$r<B9T$7$F$$$k%f!<%6(B ($BDL>o(B root) $B$N8"8B$G(B
$BG$0U$N%3!<%I$rIT@5$K<B9T$9$k$3$H$,2DG=$G$9(B.


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

[$BLuCm(B] $B<!$N$$$:$l$+$K=>$C$F$/$@$5$$(B.

1) Disable the telnet service, which is usually run out of inetd:
comment out lines in /etc/inetd.conf that begin with the word `telnet',
if present, e.g.

1) inetd $B$+$i<B9T$5$l$k(B telnet $B%5!<%S%9$rL58z$K$7$^$9(B.
   /etc/inetd.conf $B$K(B, $B$?$H$($P<!$N$h$&$J(B `telnet' $B$G;O$^$k9T$,(B
   $BB8:_$9$k>l9g$O(B, $B$=$N9T$r%3%a%s%H%"%&%H$7$F$/$@$5$$(B.

telnet stream tcp  nowait root /usr/local/libexec/telnetd telnetd

telnet stream tcp6 nowait root /usr/local/libexec/telnetd telnetd

and execute the following command as root:

   $B$=$7$F<!$N%3%^%s%I$r(B root $B8"8B$G<B9T$7$^$9(B.

# kill -HUP `cat /var/run/inetd.pid`

2) Impose access restrictions using TCP wrappers (/etc/hosts.allow),
or a network-level packet filter such as ipfw(8) or ipf(8) on the
perimeter firewall or the local machine, to limit access to the telnet
service to trusted machines.

2) $B%U%!%$%"%&%)!<%k$"$k$$$O%m!<%+%k%^%7%s>e$G(B TCP wrappers (/etc/hosts.allow)
   $B$b$7$/$O(B ipfw(8) $B$d(B ipf(8) $B$H$$$C$?%M%C%H%o!<%/%l%Y%k$N%Q%1%C%H%U%#%k%?$r(B
   $BMQ$$$F%"%/%;%9@)8B$r9T$J$$(B, telnet $B%5!<%S%9$r?.Mj$G$-$k%^%7%s$K(B
   $B@)8B$7$^$9(B.

3) Deinstall the affected ports/packages if they are installed.

3) $B<eE@$r;}$D(B ports/packages $B$,%$%s%9%H!<%k$5$l$F$$$k>l9g$O(B,
   $B$=$l$i$r:o=|$7$^$9(B.


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

The updated ports include fixes for this vulnerability:
   krb5-1.2.2_2 and later
   heimdal-0.4b_1 and later

$B$3$N<eE@$,=$@5$5$l$??7$7$$(B port $B$O0J2<$N$H$*$j$G$9(B.
   krb5-1.2.2_2 $B$*$h$S(B, $B$=$l$h$j?7$7$$%P!<%8%g%s$N(B krb5
   heimdal-0.4b_1 $B$*$h$S(B, $B$=$l$h$j?7$7$$%P!<%8%g%s(B heimdal

1) Upgrade your entire ports collection and rebuild the affected
ports (packages are not currently available for these ports).

1) Ports Collection $BA4BN$r%"%C%W%0%l!<%I$7(B, $B<eE@$r;}$C$?(B port $B$r(B
   $B:F9=C[$7$^$9(B ($B8=:_(B, $B$3$l$i$N(B port $B$KBP1~$9$k(B package $B$ODs6!$5$l$F$$$^$;$s(B).

2) Download a new port skeleton for the affected ports from:

2) $B<eE@$r;}$D3F(B port $B$KBP1~$9$k?7$7$$(B port $B%9%1%k%H%s$r(B
   $B0J2<$N>l=j$+$i%@%&%s%m!<%I$7(B, $B$=$l$i$r;H$C$F(B port $B$r:F9=C[$7$^$9(B.

http://www.freebsd.org/ports/

and use it to rebuild the port.

3) Use the portcheckout utility to automate option (2) above. The
portcheckout port is available in /usr/ports/devel/portcheckout or the
package can be obtained from:

3) $B>e5-(B (2) $B$NA`:n$r<+F0E*$K9T$J$&(B portcheckout $B%f!<%F%#%j%F%#$r;H$$$^$9(B.
   portcheckout $B$N(B port $B$O(B /usr/ports/devel/portcheckout $B$K$"$j$^$9(B.
   $B$^$?(B, portcheckout $B$N(B package $B$,0J2<$N>l=j$+$iF~<j2DG=$G$9(B.

ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-stable/devel/portcheckout-2.0.tgz
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current/devel/portcheckout-2.0.tgz


VI.  $B=$@5$N>\:Y(B - Correction details

The following list contains the revision numbers of each file that was
corrected in the FreeBSD ports collection.

$B<!$NI=$O(B, FreeBSD Ports Collection $B$G=$@5$5$l$?%U%!%$%k$N(B
$B%j%S%8%g%sHV9f$N0lMw$G$9(B.

Affected port (module)
  Path                                                           Revision
$B<eE@$r;}$C$?(B port $BL>(B ($B%b%8%e!<%kL>(B)
  $B%Q%9L>(B                                                     $B%j%S%8%g%sHV9f(B
- -------------------------------------------------------------------------
MIT Kerberos V (krb5)
  ports/security/krb5/Makefile                                       1.27
  ports/security/krb5/files/patch-appl::telnet::telnetd::authenc.c    1.1
  ports/security/krb5/files/patch-appl::telnet::telnetd::ext.h        1.2
  ports/security/krb5/files/patch-appl::telnet::telnetd::slc.c        1.1
  ports/security/krb5/files/patch-appl::telnet::telnetd::state.c      1.2
  ports/security/krb5/files/patch-appl::telnet::telnetd::telnetd.c    1.2
  ports/security/krb5/files/patch-appl::telnet::telnetd::termstat.c   1.1
  ports/security/krb5/files/patch-appl::telnet::telnetd::utility.c    1.2
Heimdal (heimdal)
  ports/security/heimdal/Makefile                                    1.39
  ports/security/heimdal/files/patch-ad                               1.6
- -------------------------------------------------------------------------


VII. $B;29M;qNA(B - References

<URL:http://www.securityfocus.com/advisories/3463>
<URL:http://www.team-teso.net/advisories/teso-advisory-011.tar.gz>
<URL:ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-01:49.telnetd.v1.1.asc>


A.   FreeBSD $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG$K$D$$$F(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$,(B
$B;29M$N$?$a$KDs6!$9$k$b$N$G$9(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.  

$B$?$@$7(B, $BK]Lu<T$*$h$S(B doc-jp $B$O(B, $B$=$NFbMF$K$D$$$F$$$+$J$kJ]>Z$b(B
$B$$$?$7$^$;$s$N$G$4Cm0U$/$@$5$$(B.  $BF|K\8lLu$K$D$$$F$N$40U8+(B, $B$4MWK>(B,
$B$*Ld$$9g$o$;Ey$O(B doc-jp@jp.FreeBSD.org $B$^$G$*4j$$$7$^$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%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.

$BF|K\$N%_%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.

$BB>$NCO0h$r4^$`(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$^$H$a$i$l$F$$$^$9(B.

$hrs: announce-jp/FreeBSD-SA/01:54,v 1.1 2001/08/21 09:22:42 hrs Exp $

----Next_Part(Tue_Aug_21_18:43:07_2001_364)----
