Return-Path: <abuse@spamalicious.com>
Received: from pacific-carrier-annex.mit.edu by po11.mit.edu (8.9.2/4.7) id PAA19845; Mon, 1 Jul 2002 15:17:19 -0400 (EDT)
Received: from mururoa.sitaranetworks.com (dhcp135.sitaranetworks.com [199.103.141.135])
	by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id PAA21413
	for <sipb@mit.edu>; Mon, 1 Jul 2002 15:16:29 -0400 (EDT)
Received: (from mycroft@localhost)
	by mururoa.sitaranetworks.com (8.11.6/8.11.6) id g61JGTx08574;
	Mon, 1 Jul 2002 19:16:29 GMT
Date: Mon, 1 Jul 2002 19:16:29 GMT
Message-Id: <200207011916.g61JGTx08574@mururoa.sitaranetworks.com>
X-Authentication-Warning: mururoa.sitaranetworks.com: mycroft set sender to abuse@spamalicious.com using -f
From: Charles Hannum <abuse@spamalicious.com>
To: sipb@mit.edu
Subject: Three problems in OpenSSH's ssh-keysign


[Thought some people here might want to know about this...]

There are 3 problems we observed by inspection of OpenSSH's
ssh-keysign:

1) [Charles Hannum] Since no blinding is done on the RSA calculations,
   ssh-keysign is effectively a fairly efficient oracle for mounting a
   Kocher timing analysis attack on the host key(s).

   (Using OAEP padding -- per recent versions of PKCS1 -- would not
   only mitigate this better, but would also mitigate other RSA
   attacks.  Unfortunately, this would require a change in the
   protocol.)

2) [Bill Sommerfeld] There is a use-after-free bug; see:

        if (valid_request(pw, host, &key, data, dlen) < 0)
                fatal("not a valid request");
	xfree(data);
        xfree(host);
	...
        if (key_sign(keys[i], &signature, &slen, data, dlen) != 0)

   (This has already been fixed in the main OpenSSH tree.)

3) [Charles Hannum] The protection of host keys is not very good; to
   wit:

        key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
        key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
                        
        seteuid(getuid());
        setuid(getuid()); 

   Although current BSD systems are safe (because they do not permit
   PTRACE_ATTACH, et al, on processes that were ever set-id), this may
   permit direct reading of the host keys by users on other systems.


Have a nice day.

