ssh-agent Vulnerability
BID:138
Info
ssh-agent Vulnerability
| Bugtraq ID: | 138 |
| Class: | Access Validation Error |
| CVE: | |
| Remote: | Yes |
| Local: | Yes |
| Published: | Jan 20 1998 12:00AM |
| Updated: | Jan 20 1998 12:00AM |
| Credit: | This vulnerability was discovered by David Sacerdote, from Secure Networks Inc. This vulnerability was first published January 20, 1998, as a Secure Networks advisory. An advisory which more or less summarized the SNI advisory was published by CERT on Ja |
| Vulnerable: |
Helsinki University of Technology ssh 1.2.21 Helsinki University of Technology ssh 1.2.19 Helsinki University of Technology ssh 1.2.18 Helsinki University of Technology ssh 1.2.17 Helsinki University of Technology ssh 1.2.16 Helsinki University of Technology ssh 1.2.15 Helsinki University of Technology ssh 1.2.14 |
| Not Vulnerable: |
Helsinki University of Technology ssh 1.2.22 |
Discussion
ssh-agent Vulnerability
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.
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.
Exploit / POC
ssh-agent Vulnerability
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.
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.
Solution / Fix
ssh-agent Vulnerability
Solution:
If using the free non-commercial SSH distribution for Unix, administrators are urged to upgrade to SSH 1.2.22 or later. Updated versions of the free unix SSH can be found at ftp://ftp.cs.hut.fi/pub/ssh
For commercial users, F-Secure SSH version 1.3.3 fixes this security problem. If you are using the commercial Data Fellows SSH package and you have a support contract, you can obtain SSH version 1.3.3 from your local retailer.
Solution:
If using the free non-commercial SSH distribution for Unix, administrators are urged to upgrade to SSH 1.2.22 or later. Updated versions of the free unix SSH can be found at ftp://ftp.cs.hut.fi/pub/ssh
For commercial users, F-Secure SSH version 1.3.3 fixes this security problem. If you are using the commercial Data Fellows SSH package and you have a support contract, you can obtain SSH version 1.3.3 from your local retailer.
References
ssh-agent Vulnerability
References:
References: