CVE-2016-0787 json
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…
published 2016-04-13 10 y ago modified 2026-06-17 4 mo ago also EUVD-2016-0800
- cvss
- 5.9
- version 3.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.6%
- EPSS 2.6% chance of exploitation in 30 days, percentile 85%
- public exploits
- 0
- none known
Summary
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."
Patch / fix
- libssh2 Debian 14, Debian 13, Debian 12 1.5.0-2.1
debian advisories DEBIAN-CVE-2016-0787
- libssh2 Ubuntu 14.04 LTS 1.4.3-2ubuntu0.1
- libssh2 Ubuntu 16.04 LTS 1.5.0-2ubuntu0.1
ubuntu advisories UBUNTU-CVE-2016-0787
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- libssh2 RHEL 6 1.4.2-2.el6_7.1
- libssh2 RHEL 7 1.4.3-10.el7_2.1
red hat advisories RHSA-2016:0428
- libssh2_org SLES for SAP 11 SP4, SLES 11 SP4, SLED 11 SP4 +1 more 1.2.9-4.2.6.1
- libssh2_org SLES for SAP 12 SP1, SLES for SAP 12, SLES 12 SP1 +5 more 1.4.3-16.1
suse advisories SUSE-SU-2016:0723-1SUSE-SU-2016:0718-1
- libssh2_org openSUSE Tumbleweed 1.7.0-1.5
opensuse advisories openSUSE-SU-2024:10190-1
- libssh2 Alpine 3.4 1.7.0-r0
alpine advisories ALPINE-CVE-2016-0787
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2016-0787 updated cvss 5.8
libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length
-
Red Hat Enterprise Linux Client (v. 7) libssh2 1.4.3-10.el7_2.1 Red Hat Enterprise Linux Client Optional (v. 7) libssh2 1.4.3-10.el7_2.1 Red Hat Enterprise Linux ComputeNode (v. 7) libssh2 1.4.3-10.el7_2.1 Red Hat Enterprise Linux ComputeNode Optional (v. 7) libssh2 1.4.3-10.el7_2.1 Red Hat Enterprise Linux Desktop (v. 6) libssh2 1.4.2-2.el6_7.1 Red Hat Enterprise Linux Desktop Optional (v. 6) libssh2 1.4.2-2.el6_7.1fixed: vendor fix RHSA-2016:0428
+10 more productsfewer
Red Hat Enterprise Linux HPC Node (v. 6) libssh2 1.4.2-2.el6_7.1 Red Hat Enterprise Linux HPC Node Optional (v. 6) libssh2 1.4.2-2.el6_7.1 Red Hat Enterprise Linux Server (v. 6) libssh2 1.4.2-2.el6_7.1 Red Hat Enterprise Linux Server (v. 7) libssh2 1.4.3-10.el7_2.1 Red Hat Enterprise Linux Server Optional (v. 6) libssh2 1.4.2-2.el6_7.1 Red Hat Enterprise Linux Server Optional (v. 7) libssh2 1.4.3-10.el7_2.1 Red Hat Enterprise Linux Workstation (v. 6) libssh2 1.4.2-2.el6_7.1 Red Hat Enterprise Linux Workstation (v. 7) libssh2 1.4.3-10.el7_2.1 Red Hat Enterprise Linux Workstation Optional (v. 6) libssh2 1.4.2-2.el6_7.1 Red Hat Enterprise Linux Workstation Optional (v. 7) libssh2 1.4.3-10.el7_2.1
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
2.59% chance of exploitation in the next 30 days, higher than 85% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.0 | 5.9 | CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 2.0 | 4.3 | AV:N/AC:M/Au:N/C:P/I:N/A:N |
Classification
- Weakness
-
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
References
-
libssh2.org
/CVE-2016-0787.patch
patch
-
lists.fedoraproject.org
/pipermail/package-announce/2016-February/177980.html
vendor-advisory
-
lists.fedoraproject.org
/pipermail/package-announce/2016-March/178573.html
vendor-advisory
-
security.gentoo.org
/glsa/201606-12
vendor-advisory, third-party-advisory
-
lists.opensuse.org
/opensuse-updates/2016-03/msg00008.html
vendor-advisory
-
debian.org
/security/2016/dsa-3487
vendor-advisory
-
libssh2.org
/adv_20160223.html
vendor-advisory
- kc.mcafee.com /corporate/index?page=content&id=SB10156
- oracle.com /technetwork/topics/security/linuxbulletinjan2016-2867209.html
- puppet.com /security/cve/CVE-2016-0787
- bto.bluecoat.com /security-advisory/sa120
-
securityfocus.com
/bid/82514
vdb-entry
Sources
- CVE List CVE-2016-0787
- NVD CVE-2016-0787
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.