From owner-doc-jp@jp.freebsd.org  Sun May 14 19:25:13 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id TAA11805;
	Sun, 14 May 2000 19:25:13 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from sv01.geocities.co.jp (sv01.geocities.co.jp [210.153.89.155])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id TAA11800
	for <doc-jp@jp.freebsd.org>; Sun, 14 May 2000 19:25:13 +0900 (JST)
	(envelope-from hrs@geocities.co.jp)
Received: from mail.geocities.co.jp (mail.geocities.co.jp [210.153.89.137]) by sv01.geocities.co.jp (8.9.3+3.2W/3.7W) with ESMTP id TAA18841 for <doc-jp@jp.freebsd.org>; Sun, 14 May 2000 19:25:13 +0900 (JST)
Received: from mail.hrs.jp (sutnmax2-ppp10.ed.noda.sut.ac.jp [133.31.173.80]) by mail.geocities.co.jp (1.3G-GeocitiesJ-3.3) with ESMTP id TAA02319 for <doc-jp@jp.freebsd.org>; Sun, 14 May 2000 19:25:10 +0900 (JST)
Message-Id: <200005141025.TAA02319@mail.geocities.co.jp>
Received: from localhost (alph.hrs.jp [192.168.0.10])
	by mail.hrs.jp (8.9.3/3.7W/DomainMaster) with ESMTP id TAA09648
	for <doc-jp@jp.freebsd.org>; Sun, 14 May 2000 19:17:32 +0900 (JST)
	(envelope-from hrs@hrs.jp)
To: doc-jp@jp.freebsd.org
In-Reply-To: <20000424224634.8A4B337B5AA@hub.freebsd.org>
References: <20000424224634.8A4B337B5AA@hub.freebsd.org>
X-Mailer: Mew version 1.94 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Date: Sun, 14 May 2000 19:17:29 +0900
From: Hiroki Sato <hrs@geocities.co.jp>
X-Dispatcher: imput version 990905(IM130)
Lines: 194
Reply-To: doc-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: doc-jp 7373
Subject: [doc-jp 7373] Re: ANNOUNCE: FreeBSD Security Advisory: FreeBSD-SA-00:14.imap-uw
Errors-To: owner-doc-jp@jp.freebsd.org
Sender: owner-doc-jp@jp.freebsd.org
X-Originator: hrs@geocities.co.jp

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

 00:14 $B$NK]Lu$G$9!#(B

--
| $B:4F#(B $B9-@8!wEl5~M}2JBg3X(B <hrs@geocities.co.jp>
|
|                                  j7397067@ed.noda.sut.ac.jp(univ)
|                        hrs@jp.FreeBSD.org(FreeBSD doc-jp Project)


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

  Subject: ANNOUNCE: FreeBSD Security Advisory: FreeBSD-SA-00:14.imap-uw
  From: FreeBSD Security Officer <security-officer@freebsd.org>
  Date: Mon, 24 Apr 2000 15:46:34 -0700 (PDT)
  Message-Id: <20000424224634.8A4B337B5AA@hub.freebsd.org>
  X-Sequence: announce-jp 422

 $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%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:14                                           Security Advisory
                                                                FreeBSD, Inc.

$B%H%T%C%/(B:	imap-uw contains security vulnerabilities for "closed"
		mail servers

$BJ,N`(B:           ports
$B%b%8%e!<%k(B:     imap-uw
$B9pCNF|(B:         2000-04-24
$B%/%l%8%C%H(B:	Michal Zalewski <lcamtuf@DIONE.IDS.PL>
		Michal Szymanski <siva9@CLICO.PL> (BugTraq ML $B$h$j(B)
$B1F6AHO0O(B:       Ports collection
$B=$@5F|(B:         $B2<5-;2>H(B
$B%Y%s%@$NBP1~(B:	$BLdBj$O3NG':Q$_$@$,(B, $B40A4$JBP1~J}K!$ODs6!$5$l$F$$$J$$(B
                Aware of the problem, no satisfactory solution provided.
FreeBSD $B$K8GM-$+(B:   NO

I.   $BGX7J(B - Background

imap-uw is a popular IMAP4/POP2/POP3 mail server from the University
of Washington.

imap-uw $B$O(B, $B%o%7%s%H%sBg3X$G3+H/$5$l$?(B, $B?M5$$N$"$k(B IMAP4/POP2/POP3
$B%a!<%k%5!<%P$G$9(B.

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

There are numerous buffer overflows available to an imap user after
they have successfully logged into their mail account
(i.e. authenticated themselves by giving the correct password,
etc). Once the user logs in, imapd has dropped root privileges and is
running as the user ID of the mail account which has been logged into,
so the buffer overflow can only allow code to be executed as that
user.

IMAP $B%5!<%P$K%m%0%$%s$7$?(B($B$D$^$j(B, $B@5$7$$%Q%9%o!<%I$J$I$rDs<($9$k$3$H$G(B
$BG'>Z$r<u$1$?(B)$B%f!<%6$KBP$7$F(B, $BHs>o$KB?$/$N%P%C%U%!%U%m!<LdBj$,B8:_$7$^$9(B.
$B%f!<%6$,%m%0%$%s$9$k$H(B, imapd $B$O(B root $B8"8B$rL58z2=$7(B, $B%m%0%$%s$7$?%f!<%6$N(B
$B8"8B$GF0:n$9$k$h$&$K$J$j$^$9(B.  $B$=$N$?$a(B, $B$3$N%P%C%U%!%U%m!<LdBj$r(B
$B0-MQ$7$?>l9g(B, $B$=$N%f!<%6$N8"8B$G%3!<%I$r<B9T$9$k$3$H$,2DG=$G$9(B.

Thus, the vulnerability is only relevant on a "closed" mail server,
i.e. one which does not normally allow interactive logins by mail
users. For a system which allows users to log in or execute code on
the system, there is minimal vulnerability.

$B$7$?$,$C$F(B, $B$3$N%;%-%e%j%F%#>e$N<eE@$O!VJD$8$?!W%a!<%k%5!<%P$K(B
$B$*$$$F$N$_LdBj$K$J$j$^$9(B.  $B!VJD$8$?!W%a!<%k%5!<%P$H$O(B, $B86B'E*$K(B
$B%a!<%k$rMxMQ$9$k%f!<%6$KBP$7$FBPOC7?%m%0%$%s$r5v2D$7$F$$$J$$$b$N$G$9(B.
$B%f!<%6$K%m%0%$%s$r5v2D$7$F$$$?$j(B, $B%3!<%I$r<B9T$G$-$k%7%9%F%`$N>l9g(B,
$B$3$N%;%-%e%j%F%#>e$N<eE@$O$[$H$s$ILdBj$H$J$j$^$;$s(B.

Note that once a user has successfully exploited the vulnerability to
gain access to their user account they may be able to mount further
attacks against the local (or a remote) machine to upgrade their
privileges.

$B$?$@$7(B, $B%f!<%6$,$3$N<eE@$r0-MQ$7$F%f!<%6%"%+%&%s%H$X$N%"%/%;%9$r3MF@$9$k(B
$B$3$H$,$G$-$?>l9g(B, $B$h$j6/$$8"8B$rF@$k$?$a$K(B, $B$5$i$J$k967b$r(B
$B%m!<%+%k(B($B$^$?$O%j%b!<%H(B)$B%^%7%s$KBP$7$F=E$M$k2DG=@-$,$"$k(B,
$B$H$$$&$3$H$KCm0U$7$F$/$@$5$$(B.

The imap-uw port is not installed by default, nor is it "part of
FreeBSD" as such: it is part of the FreeBSD ports collection, which
contains over 3200 third-party applications in a ready-to-install
format. The ports collection shipped with FreeBSD 4.0 contains this
problem since it was discovered after the release.

FreeBSD makes no claim about the security of these third-party
applications, although an effort is underway to provide a security
audit of the most security-critical ports.

imap-uw $B$N(B port $B$O(B, $B%G%U%)%k%H$G%$%s%9%H!<%k$5$l$k$b$N$G$O$J$/(B, 
FreeBSD $B%7%9%F%`$N0lIt$r9=@.$9$k$b$N$G$b$"$j$^$;$s(B.  $B$=$l$O(B, 3200 $B$r(B
$BD6$($k%5!<%I%Q!<%F%#@=$N%"%W%j%1!<%7%g%s$,$9$0$K%$%s%9%H!<%k$G$-$k7A$G(B
$B<}$a$i$l$F$$$k(B FreeBSD Ports Collection $B$N0lIt$G$9(B.  $B$3$N%;%-%e%j%F%#>e$N(B
$B<eE@$,H/8+$5$l$?$N$,%j%j!<%9;~E@$h$j8e$G$"$C$?$3$H$+$i(B, FreeBSD 4.0 $B$K(B
$B4^$^$l$k(B Ports Collection $B$K$b(B, $B$3$NLdBj$,B8:_$7$^$9(B.  

FreeBSD $B$G$O(B, $B$3$N$h$&$J%5!<%I%Q!<%F%#@=%"%W%j%1!<%7%g%s$N%;%-%e%j%F%#LdBj$K(B
$BBP$7$F(B, $BFC$K2?$+$r<gD%$9$k$3$H$O$"$j$^$;$s(B($BLuCm(B: Ports Collection $B$KF~$C$F(B
$B$$$k$+$i$H$$$C$F(B, FreeBSD $B$N3+H/<T$?$A$,$=$N%"%W%j%1!<%7%g%s$,0BA4$G$"$k$H(B
$BI>2A$7$?$o$1$G$O$"$j$^$;$s(B). $B$?$@$7(B, $B%;%-%e%j%F%#LdBj$KBP$7$FBg$-$J1F6A$r(B
$B;}$D$h$&$J(B ports $B$KBP$9$k%;%-%e%j%F%#4F::$rDs6!$9$Y$/(B, $B8=:_EXNOCf$G$9(B. 

III. $B1F6AHO0O(B - Impact

A user with a mail account on the imap server can execute arbitrary
code as themselves on that machine. This is only likely to be a
security issue on "closed" mail servers which do not allow interactive
shell logins.

IMAP $B%5!<%P$K%a!<%k%"%+%&%s%H$r=jM-$7$F$$$k%f!<%6$O(B, $B%5!<%P%^%7%s>e$K(B
$B$*$$$F(B, $B<+?H$N%f!<%68"8B$GG$0U$N%3!<%I$r<B9T$9$k$3$H$,2DG=$G$9(B.
$B$3$l$O(B, $BBPOC7?%7%'%k%m%0%$%s$,6X;_$5$l$F$$$k(B, $B$$$o$f$k!VJD$8$?!W%a!<%k(B
$B%5!<%P$G$N$_(B, $B%;%-%e%j%F%#>e$NLdBj$K$J$k$H;W$o$l$^$9(B.

Only imapd is known to be vulnerable to this time - the other daemons
installed by the imap-uw port (ipop2d/ipop3d) are not known to suffer
from the same vulnerability.

$B8=;~E@$G%;%-%e%j%F%#>e$N<eE@$NB8:_$,3NG'$5$l$F$$$k$N$O(B, imapd $B$@$1$G$9(B.
imap-uw port $B$K$h$j%$%s%9%H!<%k$5$l$k(B, $B$=$NB>$N%G!<%b%s(B(ipop2d/ipop3d)$B$K(B
$BF1MM$N<eE@$,B8:_$9$k$+$I$&$+$OITL@$G$9(B.

If you have not chosen to install the imap-uw port/package, then your
system is not vulnerable to this problem.

imap-uw $B$N(B port $B$b$7$/$O(B package $B$r%$%s%9%H!<%k$7$F$$$J$1$l$P(B, $B$=$N(B
$B%7%9%F%`$K$3$NLdBj$K$h$k%;%-%e%j%F%#>e$N<eE@$O$"$j$^$;$s(B.

IV.  $BBP1~:v(B - Workaround

1) Deinstall the imap-uw port/package, if you you have installed it.

1) imap-uw $B$N(B port/package $B$,%$%s%9%H!<%k$5$l$F$$$k>l9g$K$O(B,
   $B$=$l$r:o=|$7$F$/$@$5$$(B.

2) If you do not specifically require imap functionality
(i.e. pop2/pop3 is sufficient) then disable the imap daemon in
/etc/inetd.conf and restart inetd (e.g. with the command 'killall -HUP
inetd')

2) $BFC$K(B IMAP $B$N5!G=$rI,MW$H$7$F$$$J$$(B($B$D$^$j(B pop2/pop3 $B$G==J,$J(B)$B>l9g$K$O(B,
   /etc/inetd.conf $B$K$"$k(B IMAP $B%G!<%b%s$rL58z2=$7!"(Binetd $B$r:F5/F0$7$F$/$@$5$$(B.
   ($B$?$H$($P(B 'killall -HUP inetd' $B$H$$$&%3%^%s%I$r;HMQ$7$^$9(B)

V.   $B=$@5=hCV(B - Solution

Unfortunately the vulnerabilities in imapd are quite extensive and no
patch is currently available to address them. There is also no
"drop-in" replacement for imap-uw currently available in ports,
although the mail/cyrus port is another imap server which may be a
suitable replacement. Cyrus has different configuration and
operational requirements than imap-uw however, which may make it
unsuitable for many users.

$B;DG0$J$,$i(B, imapd $B$KB8:_$9$k$3$N%;%-%e%j%F%#>e$N<eE@$O(B, $B9-$$HO0O$K(B
$B9-$,$C$F$*$j(B, $B$=$l$i$r=$@5$9$k%Q%C%A$O8=;~E@$GDs6!$5$l$F$$$^$;$s(B.
$BBe$o$j$KMxMQ$G$-$k(B IMAP $B%5!<%P$H$7$F(B mail/cyrus $B$H$$$&(B port $B$,$"$j$^$9$,(B,
$B8=:_$N(B ports $B$K$O(B, $B$A$g$&$I(B imap-uw $B$HCV$-49$($k$3$H$,$G$-$k$h$&$J(B port $B$O(B
$B$"$j$^$;$s(B.  cyrus $B$O(B imap-uw $B$H$O0[$J$k@_Dj$HA`:n$rI,MW$H$9$k$?$a(B,
$BB?$/$NMxMQ<T$K$H$C$F(B, $B$=$l$O(B imap-uw $B$NBeBX$H$7$F$U$5$o$7$$$b$N$G$O(B
$B$J$$$G$7$g$&(B.

Until a security audit of the imap-uw source can be completed and the
vulnerabilities patched, it is recommended that operators of "closed"
imapd servers take steps to minimize the impact of users being able to
run code on the server (i.e., by tightening the local security on the
machine to minimize the damage an intruding user can cause).

imap-uw $B$N%=!<%9$KBP$9$k%;%-%e%j%F%#D4::$,40N;$7(B, $B<eE@$K=$@5%Q%C%A$,(B
$BE,MQ$5$l$k$^$G(B, $B!VJD$8$?!W(Bimapd $B%5!<%P$N4IM}<T$O(B, $B$=$N%5!<%P$G(B
$B%W%m%0%i%`%3!<%I$r<B9T$G$-$k%f!<%6$K$h$k1F6A$r(B, ($B?/F~$7$h$&$H$9$k(B
$B%f!<%6$K$h$kHo32$r:G>.8B$K$9$k$?$a(B, $B%^%7%s$N%m!<%+%k%;%-%e%j%F%#$r(B
$B6/2=$7$F(B) $B2DG=$J8B$j>.$5$/$9$kBP:v$r$H$k$3$H$r?d>)$7$^$9(B.  

This advisory will be updated once the known vulnerabilities in
imap-uw have been addressed.

$B$3$N%;%-%e%j%F%#4+9p$O(B, imap-uw $B$KB8:_$9$k(B
$B$3$N4{CN$N<eE@$KBP$7$FBP:v$,9T$J$o$l$?8e$K(B, $B99?7$5$l$kM=Dj$G$9(B.
