CVE-2016-0787
published 2016-04-13CVE-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…
PriorityP430medium5.9CVSS 3.0
AVNACHPRNUINSUCHINAN
EPSS
2.70%
84.3th percentile
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."
Affected
11 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | debian_linux | — | — |
| debian | debian_linux | — | — |
| debian | libssh2 | < libssh2 1.5.0-2.1 (bookworm) | libssh2 1.5.0-2.1 (bookworm) |
| fedoraproject | fedora | — | — |
| fedoraproject | fedora | — | — |
| libssh2 | libssh2 | <= 1.6.0 | — |
| libssh2 | libssh2 | >= 0 < 1.5.0-2.1 | 1.5.0-2.1 |
| libssh2 | libssh2 | >= 0 < 1.5.0-2.1 | 1.5.0-2.1 |
| libssh2 | libssh2 | >= 0 < 1.5.0-2.1 | 1.5.0-2.1 |
| libssh2 | libssh2 | >= 0 < 1.5.0-2.1 | 1.5.0-2.1 |
| opensuse | opensuse | — | — |
CVSS provenance
nvdv3.05.9MEDIUMCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
nvdv2.04.3MEDIUMAV:N/AC:M/Au:N/C:P/I:N/A:N
osv5.9MEDIUM
vendor_debian5.9MEDIUM
vendor_redhat5.9MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length
vendor_redhat·2016-02-23·CVSS 5.9
CVE-2016-0787 [MEDIUM] CWE-704 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length
libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length
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."
A type confusion issue was found in the way libssh2 generated ephemeral secrets for the diffie-hellman-group1 and diffie-hellman-group14 key exchange methods. This would cause an SSHv2 Diffie-Hellman handshake to use significantly less secure random parameters.
Debian
CVE-2016-0787: libssh2 - The diffie_hellman_sha256 function in kex.c in libssh2 before 1.7.0 improperly t...
vendor_debian·2016·CVSS 5.9
CVE-2016-0787 [MEDIUM] CVE-2016-0787: libssh2 - The diffie_hellman_sha256 function in kex.c in libssh2 before 1.7.0 improperly t...
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."
Scope: local
bookworm: resolved (fixed in 1.5.0-2.1)
bullseye: resolved (fixed in 1.5.0-2.1)
forky: resolved (fixed in 1.5.0-2.1)
sid: resolved (fixed in 1.5.0-2.1)
trixie: resolved (fixed in 1.5.0-2.1)
GHSA
GHSA-6wmj-27wm-wwx6: The diffie_hellman_sha256 function in kex
ghsa_unreviewed·2022-05-14
CVE-2016-0787 [MEDIUM] CWE-200 GHSA-6wmj-27wm-wwx6: The diffie_hellman_sha256 function in kex
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: The diffie_hellman_sha256 function in kex
osv·2016-04-13·CVSS 5.9
CVE-2016-0787 [MEDIUM] CVE-2016-0787: The diffie_hellman_sha256 function in kex
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."
No detection rules found.
Bugzilla
CVE-2016-0787 mingw-libssh2: libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [epel-7]
bugzilla·2016-02-23·CVSS 5.9
CVE-2016-0787 [MEDIUM] CVE-2016-0787 mingw-libssh2: libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [epel-7]
CVE-2016-0787 mingw-libssh2: libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [epel-7]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora EPEL.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
[bug auto
Bugzilla
CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [epel-5]
bugzilla·2016-02-23·CVSS 5.9
CVE-2016-0787 [MEDIUM] CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [epel-5]
CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [epel-5]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora EPEL.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
[bug automatically creat
Bugzilla
CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [fedora-all]
bugzilla·2016-02-23·CVSS 5.9
CVE-2016-0787 [MEDIUM] CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [fedora-all]
CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issue affects
Bugzilla
CVE-2016-0787 mingw-libssh2: libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [fedora-all]
bugzilla·2016-02-23·CVSS 5.9
CVE-2016-0787 [MEDIUM] CVE-2016-0787 mingw-libssh2: libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [fedora-all]
CVE-2016-0787 mingw-libssh2: libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this
Bugzilla
CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length
bugzilla·2016-02-09·CVSS 5.9
CVE-2016-0787 [MEDIUM] CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length
CVE-2016-0787 libssh2: bits/bytes confusion resulting in truncated Diffie-Hellman secret length
It was found that during the SSHv2 handshake when libssh2 is to get a suitable value for 'group order' in the Diffle Hellman negotiation, it would pass in number of bytes to a function that expected number of bits. This would result in the library generating numbers using only an 8th the number of random bits than what were intended: 128 or 256 bits instead of 1023 or 2047. Using such drastically reduced amount of random bits for Diffie Hellman weakended the handshake security significantly.
Discussion:
There is a bits/bytes confusion bug and generate the an anormaly short ephemeral secret for the diffie-hellman-group1 and diffie-hellman-group14 key exchange methods.
The resulting secret is 1
http://lists.fedoraproject.org/pipermail/package-announce/2016-February/177980.htmlhttp://lists.fedoraproject.org/pipermail/package-announce/2016-March/178573.htmlhttp://lists.opensuse.org/opensuse-updates/2016-03/msg00008.htmlhttp://www.debian.org/security/2016/dsa-3487http://www.oracle.com/technetwork/topics/security/linuxbulletinjan2016-2867209.htmlhttp://www.securityfocus.com/bid/82514https://bto.bluecoat.com/security-advisory/sa120https://kc.mcafee.com/corporate/index?page=content&id=SB10156https://puppet.com/security/cve/CVE-2016-0787https://security.gentoo.org/glsa/201606-12https://www.libssh2.org/CVE-2016-0787.patchhttps://www.libssh2.org/adv_20160223.htmlhttp://lists.fedoraproject.org/pipermail/package-announce/2016-February/177980.htmlhttp://lists.fedoraproject.org/pipermail/package-announce/2016-March/178573.htmlhttp://lists.opensuse.org/opensuse-updates/2016-03/msg00008.htmlhttp://www.debian.org/security/2016/dsa-3487http://www.oracle.com/technetwork/topics/security/linuxbulletinjan2016-2867209.htmlhttp://www.securityfocus.com/bid/82514https://bto.bluecoat.com/security-advisory/sa120https://kc.mcafee.com/corporate/index?page=content&id=SB10156https://puppet.com/security/cve/CVE-2016-0787https://security.gentoo.org/glsa/201606-12https://www.libssh2.org/CVE-2016-0787.patchhttps://www.libssh2.org/adv_20160223.html
2016-04-13
Published