Vulnerability in libssh leading to buffer overflow

In the libssh library (not to be confused with libssh2), designed to add client and server support for the SSHv2 protocol in C programs, a vulnerability has been identified (CVE-2021-3634) leading to a buffer overflow when initiating a key change process (rekey) using a key exchange mechanism that employs a different hash algorithm. The issue has been resolved in release 0.9.6.

The crux of the problem is that the key change operation allows the use of cryptographic hashes with a digest size different from the originally used algorithm. Memory for the hash in libssh was allocated based on the original hash size, and using a larger hash size results in overwriting data outside the allocated buffer. As a fallback protective method, the list of supported key exchange methods can be restricted to algorithms with the same hash size. For example, to bind to SHA256 in the code, one can add: rc = ssh_options_set(s->ssh.session, SSH_OPTIONS_KEY_EXCHANGE, "diffie-hellman-group14-sha256,curve25519-sha256,ecdh-sha2-nistp256");

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster