---
title: "CVE-2016-0787\n    | Ubuntu"
description: Ubuntu is an open source software operating system that runs from the
  desktop, to the cloud, to all your internet connected things.
url: https://ubuntu.com/security/CVE-2016-0787?format=md
keywords: index, follow
---

# CVE-2016-0787

Publication date 13 April 2016

Last updated 25 August 2025

---

Ubuntu priority

**Medium**

[Why this priority?](https://ubuntu.com/security/cves/about#priority )

## Cvss 3 Severity Score

**5.9 · Medium**

[Score breakdown](https://ubuntu.com/security/CVE-2016-0787?format=md#impact-score)

Toggle side navigation

## 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."

[Read the notes from the security team](https://ubuntu.com/security/CVE-2016-0787?format=md#notes)

## Status

Show unmaintained releases

| Package | Ubuntu Release | Status |
| --- | --- | --- |
| libssh2 | 16.10 yakkety | Fixed 1.7.0-1ubuntu0.1 |
| 16.04 LTS xenial | Fixed 1.5.0-2ubuntu0.1 |
| 15.10 wily | Ignored end of life |
| 14.04 LTS trusty | Fixed 1.4.3-2ubuntu0.1 |
| 12.04 LTS precise | Fixed 1.2.8-2ubuntu0.1 |

---

* [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)
* [What do statuses mean?](https://ubuntu.com/security/cves/about#statuses)
* [Patch details](https://ubuntu.com/security/CVE-2016-0787?format=md#patch-details)

## Notes

---

### [seth-arnold](https://launchpad.net/~seth-arnold)

Debian noted there may be discussion of incomplete fix

### Patch details

For informational purposes only. We recommend not to cherry-pick updates. [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)

| Package | Patch details |
| --- | --- |
| libssh2 | * Upstream:   [ca5222e](https://github.com/libssh2/libssh2/commit/ca5222ea819cc5ed797860070b4c6c1aeeb28420) * Upstream:   [7934c9c](https://github.com/libssh2/libssh2/commit/7934c9ce2a029c43e3642a492d3b9e494d1542be) |

## Severity score breakdown

CVSS version:
CVSS v3.0

**Base score**

5.9 · Medium

* Base metrics

  | Parameter | Value |
  | --- | --- |
  | Attack vector | Network |
  | Attack complexity | High |
  | Privileges required | None |
  | User interaction | None |
  | Scope | Unchanged |
  | Confidentiality impact | High |
  | Integrity impact | None |
  | Availability impact | None |
* Scores

  | Parameter | Value |
  | --- | --- |
  | Base score | 5.9 · Medium |
  | Exploitability score | - |
  | Impact score | - |

**Vector:** CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

## References

* [MITRE](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0787)
* [NVD](https://nvd.nist.gov/vuln/detail/CVE-2016-0787)
* [Launchpad](https://launchpad.net/bugs/cve/CVE-2016-0787)
* [Debian](https://security-tracker.debian.org/tracker/CVE-2016-0787)

### Other references

* <https://www.libssh2.org/adv_20160223.html>
* <https://www.cve.org/CVERecord?id=CVE-2016-0787>
