From owner-freebsd-security@FreeBSD.ORG Mon Dec 5 19:45:09 2011 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56EB81065672 for ; Mon, 5 Dec 2011 19:45:09 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1-6.sentex.ca [IPv6:2607:f3e0:0:1::12]) by mx1.freebsd.org (Postfix) with ESMTP id 14DA78FC0A for ; Mon, 5 Dec 2011 19:45:08 +0000 (UTC) Received: from [IPv6:2607:f3e0:0:4:f025:8813:7603:7e4a] (saphire3.sentex.ca [IPv6:2607:f3e0:0:4:f025:8813:7603:7e4a]) by smarthost1.sentex.ca (8.14.5/8.14.4) with ESMTP id pB5JioAC055050; Mon, 5 Dec 2011 14:44:51 -0500 (EST) (envelope-from mike@sentex.net) Message-ID: <4EDD1F2F.20802@sentex.net> Date: Mon, 05 Dec 2011 14:44:47 -0500 From: Mike Tancsa Organization: Sentex Communications User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: d@delphij.net References: <4ED68B4D.4020004@sentex.net> <4ED69B7E.50505@frasunek.com> <4ED6C3C6.5030402@delphij.net> <4ED6D1CD.9080700@sentex.net> <4ED6D577.9010007@delphij.net> In-Reply-To: <4ED6D577.9010007@delphij.net> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.71 on IPv6:2607:f3e0:0:1::12 Cc: "freebsd-security@freebsd.org" , Xin LI , Przemyslaw Frasunek Subject: Re: ftpd security issue ? X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 19:45:09 -0000 On 11/30/2011 8:16 PM, Xin LI wrote: > On 11/30/11 17:01, Mike Tancsa wrote: >> On 11/30/2011 7:01 PM, Xin LI wrote: >>> >>>> BTW. This vulnerability affects only configurations, where >>>> /etc/ftpchroot exists or anonymous user is allowed to create >>>> files inside etc and lib dirs. >>> >>> This doesn't seem to be typical configuration or no? > >> I think in shared hosting environments it would be somewhat common. >> For annon ftp, I dont think the anon user would be able to create / >> write to a lib directory. > >>> >>> Will the attached patch fix the problem? >>> >>> (I think libc should just refuse /etc/nsswitch.conf and libraries >>> if they are writable by others by the way) > >> It does not seem to prevent the issue for me. Using Przemyslaw >> program's, > > Sorry I patched at the wrong place, this one should do. > > Note however this is not sufficient to fix the problem, for instance > one can still upload .so's that run arbitrary code at his privilege, > which has to be addressed in libc. I need some time to play around > with libc to really fix this one. Forgive the naive question, but is there a way to prevent a process (in this case proftpd) from loading a .so if the session is in a chrooted environment ? Or if at the start of the process, is there a way to force the process to load a lib so that later on, it wont try and load the "bad" lib ? ---Mike -- ------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/