CVE-2016-0787: 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…
Noroxi assessment
Priority: Monitor (action score 24/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 2.5% (FIRST EPSS); higher than 85.5% of all records.
- Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. Special conditions such as timing or configuration are required.
- Fixed version: libssh2 (Alpine:v3.4) 1.7.0-r0; libssh2 (Debian:12) 1.5.0-2.1; libssh2 (Debian:6.0) 1.2.6-1+deb6u2.
Low priority for now. Upgrade to libssh2 (Alpine:v3.4) 1.7.0-r0; libssh2 (Debian:12) 1.5.0-2.1; libssh2 (Debian:6.0) 1.2.6-1+deb6u2 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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."
- Published
- Apr 13, 2016
- Updated
- Jun 16, 2026
- EPSS
- 2.5% · 85th percentile
- CWE
- CWE-200
Report tools
Action score
24
Low priority for now.
- CVSS
- 23 / 40 · 5.9 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 2.5%
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| libssh2 | libssh2 | cpe:2.3:a:libssh2:libssh2 |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
| opensuse | opensuse | cpe:2.3:o:opensuse:opensuse |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- debian debian linux7.0
- debian debian linux8.0
- fedoraproject fedora22
- fedoraproject fedora23
- libssh2 libssh2up to 1.6.0 inclusive
- opensuse opensuse13.2
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Alpine:v3.4 | libssh2 | before 1.7.0-r0 | 1.7.0-r0 |
| Debian:12 | libssh2 | before 1.5.0-2.1 | 1.5.0-2.1 |
| Debian:6.0 | libssh2 | before 1.2.6-1+deb6u2 | 1.2.6-1+deb6u2 |
| Debian:7 | libssh2 | before 1.4.2-1.1+deb7u2 | 1.4.2-1.1+deb7u2 |
| Debian:8 | libssh2 | before 1.4.3-4.1+deb8u1 | 1.4.3-4.1+deb8u1 |
| openSUSE:Tumbleweed | libssh2_org | before 1.7.0-1.5 | 1.7.0-1.5 |
| Red Hat:enterprise_linux:6::client | libssh2 | before 0:1.4.2-2.el6_7.1 | 0:1.4.2-2.el6_7.1 |
| Red Hat:enterprise_linux:6::client | libssh2-debuginfo | before 0:1.4.2-2.el6_7.1 | 0:1.4.2-2.el6_7.1 |
| Red Hat:enterprise_linux:6::client | libssh2-devel | before 0:1.4.2-2.el6_7.1 | 0:1.4.2-2.el6_7.1 |
| Red Hat:enterprise_linux:6::client | libssh2-docs | before 0:1.4.2-2.el6_7.1 | 0:1.4.2-2.el6_7.1 |
| Red Hat:enterprise_linux:7::client | libssh2 | before 0:1.4.3-10.el7_2.1 | 0:1.4.3-10.el7_2.1 |
| Red Hat:enterprise_linux:7::client | libssh2-debuginfo | before 0:1.4.3-10.el7_2.1 | 0:1.4.3-10.el7_2.1 |
| Red Hat:enterprise_linux:7::client | libssh2-devel | before 0:1.4.3-10.el7_2.1 | 0:1.4.3-10.el7_2.1 |
| Red Hat:enterprise_linux:7::client | libssh2-docs | before 0:1.4.3-10.el7_2.1 | 0:1.4.3-10.el7_2.1 |
| SUSE:Linux Enterprise Desktop 12 | libssh2_org | before 1.4.3-16.1 | 1.4.3-16.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | libssh2_org | before 1.2.9-4.2.6.1 | 1.2.9-4.2.6.1 |
Same product
libssh2: all recordsOther highest-scoring records for the same primary product.
- CVE-2019-3861An out of bounds read flaw was discovered in libssh2 before 1.8.1 in the way SSH packets with a padding length value greater than the…38Monitor
- CVE-2019-3860An out of bounds read flaw was discovered in libssh2 before 1.8.1 in the way SFTP packets with empty payloads are parsed.38Monitor
- CVE-2019-3858An out of bounds read flaw was discovered in libssh2 before 1.8.1 when a specially crafted SFTP packet is received from the server.38Monitor
Published before and after this one in the same product
- ← EarlierCVE-2015-1782Mar 13, 2015 · The kex_agree_methods function in libssh2 before 1.5.0 allows remote servers to cause a denial of service (crash) or have other unspecified…28Monitor
- Later →CVE-2019-3859Mar 21, 2019 · An out of bounds read flaw was discovered in libssh2 before 1.8.1 in the _libssh2_packet_require and _libssh2_packet_requirev functions.38Monitor
- Later →CVE-2019-3862Mar 21, 2019 · An out of bounds read flaw was discovered in libssh2 before 1.8.1 in the way SSH_MSG_CHANNEL_REQUEST packets with an exit status message…38Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| alpine:libssh2 | 1.7.0-r0 · Alpine:v3.4 | Package registry (OSV) |
| debian:libssh2 | 1.5.0-2.1 · Debian:12 | Package registry (OSV) |
| opensuse:libssh2_org | 1.7.0-1.5 · openSUSE:Tumbleweed | Package registry (OSV) |
| red hat:libssh2 | 0:1.4.2-2.el6_7.1 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:libssh2-debuginfo | 0:1.4.2-2.el6_7.1 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:libssh2-devel | 0:1.4.2-2.el6_7.1 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:libssh2-docs | 0:1.4.2-2.el6_7.1 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| suse:libssh2_org | 1.4.3-16.1 · SUSE:Linux Enterprise Desktop 12 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- high · data can be read
- Integrity
- none
- Availability
- none
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- None
- Availability impact
- None
Weakness class (CWE)
CWE-200 · Exposure of Sensitive Information to an Unauthorized ActorCVSS vector
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
nvd-primary
Root cause
The extension requests broader permissions than its function needs and sends the data it collects out for purposes beyond its stated function.
The bug in code
The whole CWE-200 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
{
"permissions": ["tabs", "<all_urls>"],
"background": { "service_worker": "analytics.js" }
}Fixed
{
"permissions": ["activeTab"],
"host_permissions": ["https://yildiz.example/*"]
}Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- ExcavationCAPEC-116likelihood: High · Medium
- Subverting Environment Variable ValuesCAPEC-13likelihood: High · Very High
- FootprintingCAPEC-169likelihood: High · Very Low
- Exploiting Trust in ClientCAPEC-22likelihood: High · High
- FingerprintingCAPEC-224likelihood: High · Very Low
- ICMP Echo Request PingCAPEC-285likelihood: Medium · Low
- TCP SYN ScanCAPEC-287Low
- Enumerate Mail Exchange (MX) RecordsCAPEC-290Low
ATT&CK techniques
- System Service DiscoveryT1007
- System Network Configuration DiscoveryT1016
- Remote System DiscoveryT1018
- System Owner/User DiscoveryT1033
- Masquerading: Match Legitimate Name or LocationT1036.005
- Network Service ScanningT1046
- System Network Connections DiscoveryT1049
- Process DiscoveryT1057
- Permission Groups DiscoveryT1069
- System Information DiscoveryT1082
- File and Directory DiscoveryT1083
- Account DiscoveryT1087
- Multi-Factor Authentication InterceptionT1111
- Peripheral Device DiscoveryT1120
- System Time DiscoveryT1124
- Access Token Manipulation:Token Impersonation/TheftT1134.001
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (11 more)Show less
- lists.fedoraproject.org/pipermail/package-announce/2016-March/178573.html
- lists.opensuse.org/opensuse-updates/2016-03/msg00008.html
- www.debian.org/security/2016/dsa-3487
- www.oracle.com/technetwork/topics/security/linuxbulletinjan2016-2867209.html
- www.securityfocus.com/bid/82514
- bto.bluecoat.com/security-advisory/sa120
- kc.mcafee.com/corporate/index?page=content&id=SB10156
- puppet.com/security/cve/CVE-2016-0787
- security.gentoo.org/glsa/201606-12
- www.libssh2.org/CVE-2016-0787.patch
- www.libssh2.org/adv_20160223.html
Vendor advisories and official records. Exploit/PoC links are deliberately left out.