Vulnerability · Published Aug 31, 2021 · Assigned by redhat

CVE-2021-3634

Medium 6.5

In plain English

A medium-severity out-of-bounds write in libssh. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 4.7% (higher than 92% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)6.5Medium
Exploit odds (30 days)4.7%top 8.2% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official description

A flaw has been found in libssh in versions prior to 0.9.6. The SSH protocol keeps track of two shared secrets during the lifetime of the session. One of them is called secret_hash and the other session_id. Initially, both of them are the same, but after key re-exchange, previous session_id is kept and used as an input to new secret_hash. Historically, both of these buffers had shared length variable, which worked as long as these buffers were same. But the key re-exchange operation can also change the key exchange method, which can be based on hash of different size, eventually creating "secret_hash" of different size than the session_id has. This becomes an issue when the session_id memory is zeroed or when it is used again during second key re-exchange.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8libssh0.9.6-3.el8ALSA-2022:2031
AlmaLinux:8libssh-config0.9.6-3.el8ALSA-2022:2031
AlmaLinux:8libssh-devel0.9.6-3.el8ALSA-2022:2031
Alpine:v3.20libssh0.9.6-r0ALPINE-CVE-2021-3634
Alpine:v3.21libssh0.9.6-r0ALPINE-CVE-2021-3634
Alpine:v3.22libssh0.9.6-r0ALPINE-CVE-2021-3634
Alpine:v3.23libssh0.9.6-r0ALPINE-CVE-2021-3634
Alpine:v3.24libssh0.9.6-r0ALPINE-CVE-2021-3634
Debian:12libssh0.9.6-1DEBIAN-CVE-2021-3634
Debian:13libssh0.9.6-1DEBIAN-CVE-2021-3634
Debian:14libssh0.9.6-1DEBIAN-CVE-2021-3634
Rocky Linux:8libssh0:0.9.6-3.el8RLSA-2022:2031
Ubuntu:22.04:LTSlibssh0.9.6-1UBUNTU-CVE-2021-3634

Affected products (as reported)

VendorProductVersions
n/a libssh libssh 0.9.6

Weakness: CWE-787

References