Home / vulnerabilities ssh3291-offbyone.txt
Posted on 15 May 2007
Source : packetstormsecurity.org Link
ssh.com ssh-3.2.9.1 sftp server remote off by one
***ATTENTION***This has not been tested under reallife conditions***
ssh-3.2.9.1 which is available from http://ftp.ssh.com/pub/ssh/
contains the same old rootd off by one bug as described bei isec.pl here:
http://www.isec.pl/vulnerabilities/isec-0011-wu-ftpd.txt
The file ssh-3.2.9.1/lib/sshfilexfer/sshunixrealpath.c reads
/*
* char *ssh_realpath(const char *path, char resolved_path[MAXPATHLEN]);
*
* Find the real name of path, by removing all ".", ".." and symlink
* components. Returns (resolved) on success, or (NULL) on failure,
* in which case the path which caused trouble is left in (resolved).
*
*/
char *ssh_realpath(const char *path, char *resolved)
{
struct stat sb;
int n, rootd, serrno;
...
...
...
...
...
/*
* Join the two strings together, ensuring that the right thing
* happens if the last component is empty, or the dirname is root.
*/
if (resolved[0] == '/' && resolved[1] == '