Description
The diffie_hellman_sha256 function in kex.c in libssh2 before 1.7.0 improperly truncates secrets to 128 or 256 bits, which makes it easier for man-in-the-middle attackers to decrypt or intercept SSH sessions via unspecified vectors, aka a "bits/bytes confusion bug."
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libssh2 | 1.5.0-2.1 | — |
| Debian 13 | libssh2 | 1.5.0-2.1 | — |
| Debian 12 | libssh2 | 1.5.0-2.1 | — |
| Debian 8 | libssh2 | 1.4.3-4.1+deb8u1 | DSA-3487-1 |
| Debian 7 | libssh2 | 1.4.2-1.1+deb7u2 | DSA-3487-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 6.0 | libssh2 | 1.2.6-1+deb6u2 | DLA-426-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | libssh2 | 1.5.0-2ubuntu0.1 | — |
| Ubuntu 14.04 LTS | libssh2 | 1.4.3-2ubuntu0.1 | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 7 | libssh2 +2 | 1.4.3-10.el7_2.1 | RHSA-2016:0428 |
| RHEL 6 | libssh2 +2 | 1.4.2-2.el6_7.1 | RHSA-2016:0428 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP1 | libssh2_org | 1.4.3-16.1 | SUSE-SU-2016:0718-1 |
| SLES 12 | libssh2_org | 1.4.3-16.1 | SUSE-SU-2016:0718-1 |
| SLES 11 SP4 | libssh2_org | 1.2.9-4.2.6.1 | SUSE-SU-2016:0723-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 12 SP1 | libssh2_org | 1.4.3-16.1 | SUSE-SU-2016:0718-1 |
| SLES for SAP 12 | libssh2_org | 1.4.3-16.1 | SUSE-SU-2016:0718-1 |
| SLES for SAP 11 SP4 | libssh2_org | 1.2.9-4.2.6.1 | SUSE-SU-2016:0723-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | libssh2_org | 1.7.0-1.5 | openSUSE-SU-2024:10190-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.4 | libssh2 | 1.7.0-r0 | — |
Advisories 6
- RHSA-2016:0428 Red Hat Security Advisory: libssh2 security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- DLA-426-1 libssh2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-3487-1 libssh2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- openSUSE-SU-2024:10190-1 libssh2-1-1.7.0-1.5 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2016:0723-1 Security update for libssh2_org SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2016:0718-1 Security update for libssh2_org SUSE / openSUSE Security Updates · Feb 4, 2026
References
- FEDORA-2016-215a2219b1 vendor-advisory
- https://kc.mcafee.com/corporate/index?page=content&id=SB10156
- http://www.oracle.com/technetwork/topics/security/linuxbulletinjan2016-2867209.html
- https://www.libssh2.org/CVE-2016-0787.patch
- https://www.libssh2.org/adv_20160223.html
- https://puppet.com/security/cve/CVE-2016-0787
- FEDORA-2016-7942ee2cc5 vendor-advisory
- GLSA-201606-12 vendor-advisory
- openSUSE-SU-2016:0639 vendor-advisory
- https://bto.bluecoat.com/security-advisory/sa120
- DSA-3487 vendor-advisory
- 82514 vdb-entry