REDHAT-BUG-2499049: Medium severity libssh libssh server-side SFTP (readdir_long_name in src/sftpserver.c) vulnerability
A flaw was found in libssh server-side SFTP directory listing. In processreaddir() in src/sftpserver.c, the server allocates a fixed stack buffer as char longname[MAXLONGNAMELEN] and passes attacker-controlled directory entry names into readdirlongname(). In the pre-patch implementation, readdirlongname() appends metadata and the filename into zlongname with repeated unbounded strcat() calls. Because zlongname points at the caller-owned fixed stack buffer, sufficiently long filenames in an attacker-controlled directory can overflow that stack buffer during SSHFXPREADDIR processing, leading to crashes and possible code execution on the server.
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2499049?
The severity of REDHAT-BUG-2499049 is medium with a score of 4.
How do I fix REDHAT-BUG-2499049?
To fix REDHAT-BUG-2499049, ensure you apply the latest patches provided by the maintainers of libssh.
What type of vulnerability is REDHAT-BUG-2499049?
REDHAT-BUG-2499049 is a flaw in the libssh server-side SFTP directory listing functionality.
What can an attacker do with REDHAT-BUG-2499049?
An attacker can exploit REDHAT-BUG-2499049 to potentially cause a buffer overflow through crafted directory entry names.
Which component is affected by REDHAT-BUG-2499049?
The affected component in REDHAT-BUG-2499049 is the libssh server-side SFTP, specifically the process_readdir() function.