www.cs.hut.fi/ssh-archive/messages/980121-145129-28265
ORG Subject: SNI-23: SSH - Vulnerability in ssh-agent -----BEGIN PGP SIGNED MESSAGE----- ###### ## ## ###### ## ### ## ## ###### ## # ## ## ## ## ### ## ###### . Security Advisory January 20, 1998 Vulnerability in ssh-agent This advisory details a vulnerabily in the SSH cryptographic login program. The vulnerability enables users to use RSA credentials belonging to other users who use the ssh-agent program. This vulnerability may allow an attacker on the same local host to login to a remote server as the user utilizing SSH. Problem Description: In order to avoid forcing users of RSA based authentication to go through the trouble of retyping their pass phrase every time they wish to use ssh, slogin, or scp, the SSH package includes a program called ssh-agent, which manages RSA keys for the SSH program. The ssh-agent program creates a mode 700 directory in /tmp, and then creates an AF_UNIX socket in that directory. Later, the user runs the ssh-add program, which adds his private key to the set of keys managed by the ssh-agent program. When the user wishes to access a service which permits him to log in using only his RSA key, the SSH client connects to the AF_UNIX socket, and asks the ssh-agent program for the key. Unfortunately, when connecting to the AF_UNIX socket, the SSH client is running as super-user, and performs insufficient permissions checking. This makes it possible for users to trick their SSH clients into using credentials belonging to other users. The end result is that any user who utilizes RSA authentication AND uses ssh-agent, is vulnerable. Attackers can utilize this vulnerability to access remote accounts belonging to the ssh-agent user. Technical Details When communicating with the ssh-agent program, the SSH program issues a connect() system call as super-user to access the AF_UNIX socket. By utilizing symbolic links, an attacker can cause the SSH program to connect to an alternate user's AF_UNIX socket, and read their RSA credentials. After the credentials have been read, SSH will use these credentials to logon to the remote system as the victim. Vulnerable Systems: This vulnerability effects the Unix versions of SSH ONLY. Users without a support contract can obtain a diff file which fixes this problem. This will prevent the attack from working, but will disable a form of authentication documented as rhosts-RSA. For example, if your SSH binary is in the /usr/local/bin directory, the following command will remove the setuid bit from the SSH binary: # chmod u-s /usr/local/bin/ssh Additional Information SSH is a cryptographic rsh, rlogin, and rcp replacement. For more information regarding this advisory, contact Secure Networks Inc. A PGP public key is provided below if privacy is required. Type Bits/KeyID Date User ID pub 1024/9E55000D 1997/01/13 Secure Networks Inc.
|