From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7421 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: Security advisory for musl libc - stack-based buffer overflow in ipv6 literal parsing [CVE-2015-1817] Date: Sat, 18 Apr 2015 12:37:03 -0400 Message-ID: <20150418163702.GI6817@brightrain.aerifal.cx> References: <20150417131008.GE17615@ucc.gu.uwa.edu.au> <20150417172327.GB6817@brightrain.aerifal.cx> <20150417180325.GC6817@brightrain.aerifal.cx> <20150417180907.GA26856@openwall.com> <20150418133202.GG17615@ucc.gu.uwa.edu.au> <20150418152542.GG6817@brightrain.aerifal.cx> <55327D1F.5070807@gmx.de> <20150418155845.GH6817@brightrain.aerifal.cx> <55328604.4000705@gmx.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1429375043 24996 80.91.229.3 (18 Apr 2015 16:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 16:37:23 +0000 (UTC) Cc: musl@lists.openwall.com, Matt Johnston To: Harald Becker Original-X-From: musl-return-7434-gllmg-musl=m.gmane.org@lists.openwall.com Sat Apr 18 18:37:22 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YjVk8-0005W8-T0 for gllmg-musl@m.gmane.org; Sat, 18 Apr 2015 18:37:20 +0200 Original-Received: (qmail 32412 invoked by uid 550); 18 Apr 2015 16:37:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32391 invoked from network); 18 Apr 2015 16:37:19 -0000 Content-Disposition: inline In-Reply-To: <55328604.4000705@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7421 Archived-At: On Sat, Apr 18, 2015 at 06:27:48PM +0200, Harald Becker wrote: > Hi ! > > @Rich: I still get DNS error (Mozilla Thunderbird) for > dalias@libc.org, when tying to send mail :( Odd. I just verified that Google's 8.8.8.8 resolves it right, so I don't know what's wrong, but it seems to be on your end. Let me know if you find anything that looks like a problem on my side. > On 18.04.2015 17:58, Rich Felker wrote: > >On Sat, Apr 18, 2015 at 05:49:51PM +0200, Harald Becker wrote: > >>On 18.04.2015 17:25, Rich Felker wrote: > >>>>The server hostkey will remain in process memory since it's > >>>>required for rekeying - not as bad as root code execution > >>>>though. > >>> > >>>Ugly. I don't see how this can be solved without a more advanced > >>>privsep model. I agree it's lower-severity though. > >> > >>IMO you may put the host keys in a file readable (not writable) > >>with a dropbear group, and only using that group for dropbear (no > >>other users or programs using that group). So you may read the keys > >>even if not root, if you add this dropbear group to setgroups (not > >>setgid) before dropping root privileges. > > > >The key is already in memory. > > As far as I understand it, the question was, *not to have* the key > hanging around in memory, but still have access without requirement to > keep root privileges. My suggestion is to solve this, with a very simple > and easy to implement solution. I consider it a slight increased > security, as the dropbear process can drop root privileges (and has to > do so), but still has access to the host keys. Well anything that gets code execution in the dropbear session process would be able to steal the key still. The only added protection you'd get is is against heartbleed-type attacks (arbitrary memory read but no code exeution). > >To make it more secure, the session process would not have any access > >to the key and would have to communicate with an existing privileged > >process to rekey. > > ACK, much better, but this would need major restructuring, wouldn't it? Yes. > So consider my suggestion a simpler to implement solution, in > between having full root privileges or hanging keys in memory, and > an external process to do the rekey steps (in addition: with the > possibility to let that process use the dropbear group and not root > to access keys - even better than let that process hang around as > root) If this external process is setuid/setgid, I consider that a much bigger vuln. It would have to somehow verify that it's being invoked by a valid dropbear session process and not some other caller that just wants to use it to steal keys/forge key negotiations, and you have all the usual issues with setuid programs having to be defensive about the state they inherit when invoked. If on the other hand the session process just kept gid=dropbear to open and reload the key, it wouldn't be so bad. Rich