Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: 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 for man-in-the-middle attackers to decrypt or intercept SSH sessions via unspecified vectors, aka a "bits/bytes confusion bug."

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2016-0787
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 05:09 UTC · Revision 1

Source evidence

CVE-2016-0787

core-osv · Original source

Published 13 Apr 2016, 17:59 UTC

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

osv:CVE-2016-0787
Complete source record
{
  "id": "8c5c3f60198950fe683fe21e2417ce21dcb8243e44fcac0ea9a6055b0237160e",
  "url": "https://osv.dev/vulnerability/CVE-2016-0787",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2016-0787",
    "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.\"",
    "evidence": "osv:CVE-2016-0787",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2016-0787",
      "aliases": [
        "CVE-2016-0787"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/libssh2/libssh2",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "cbd5f72339dae6bfc587f4486f4349dd1d61f9b7"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:libssh2:libssh2:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "1.6.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "libssh2-1.6.0",
            "libssh2-1.5.0",
            "libssh2-1.4.3",
            "libssh2-1.4.2",
            "libssh2-1.4.1",
            "libssh2-1.4.0",
            "libssh2-1.3.0",
            "libssh2-1.2.9",
            "libssh2-1.2.8",
            "libssh2-1.2.7",
            "libssh2-1.2.6",
            "libssh2-1.2.5",
            "libssh2-1.2.4",
            "libssh2-1.2.3",
            "libssh2-1.2.1",
            "libssh2-1.2",
            "RELEASE.1.1",
            "RELEASE.1.0",
            "RELEASE.0.18",
            "RELEASE.0.17",
            "RELEASE.0.16",
            "RELEASE.0.15",
            "beforenb2-0.14",
            "beforenb-0.14",
            "RELEASE.0.14",
            "RELEASE.0.13",
            "RELEASE.0.12",
            "RELEASE.0.11",
            "RELEASE.0.10",
            "RELEASE.0.8",
            "RELEASE.0.7",
            "RELEASE.0.6",
            "RELEASE.0.5",
            "RELEASE.0.3",
            "RELEASE.0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2016-0787.json"
          }
        }
      ],
      "modified": "2026-10-24T10:30:25.215683210Z",
      "provider": "osv",
      "references": [
        "https://kc.mcafee.com/corporate/index?page=content&id=SB10156",
        "https://puppet.com/security/cve/CVE-2016-0787",
        "https://bto.bluecoat.com/security-advisory/sa120",
        "https://security.gentoo.org/glsa/201606-12",
        "https://www.libssh2.org/adv_20160223.html",
        "https://www.libssh2.org/CVE-2016-0787.patch"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:o:debian:debian_linux:7.0:*:*:*:*:*:*:*",
              "cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*"
            ],
            "vendor_product": "debian:debian_linux",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "7.0"
                  },
                  {
                    "last_affected": "7.0"
                  },
                  {
                    "introduced": "8.0"
                  },
                  {
                    "last_affected": "8.0"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          },
          {
            "cpes": [
              "cpe:2.3:o:fedoraproject:fedora:22:*:*:*:*:*:*:*",
              "cpe:2.3:o:fedoraproject:fedora:23:*:*:*:*:*:*:*"
            ],
            "vendor_product": "fedoraproject:fedora",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "22"
                  },
                  {
                    "last_affected": "22"
                  },
                  {
                    "introduced": "23"
                  },
                  {
                    "last_affected": "23"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          },
          {
            "cpes": [
              "cpe:2.3:o:opensuse:opensuse:13.2:*:*:*:*:*:*:*"
            ],
            "vendor_product": "opensuse:opensuse",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "13.2"
                  },
                  {
                    "last_affected": "13.2"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2016-0787",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 431310,
  "published_at": "2016-04-13T17:59:10.93+00:00"
}