libssh2: integer overflow in kex_method_diffie_hellman_group_exchange_sha256_key_exchange in kex.c leads to out-of-bounds write (CVE-2019-13115)
A vulnerability was discovered in libssh2 before 1.9.0, kex_method_diffie_hellman_group_exchange_sha256_key_exchange in kex.c has an integer overflow that could lead to an out-of-bounds write in the way packets are read from the server. A remote attacker who compromises a SSH server may be able to execute code on the client system when a user connects to the server. This is related to an _libssh2_check_length mistake, and is different from the various issues fixed in 1.8.1, such as CVE-2019-3855.
References:
- https://libssh2.org/changes.html
- https://github.com/libssh2/libssh2/pull/350
- https://nvd.nist.gov/vuln/detail/CVE-2019-13115
Patch:
https://github.com/doorsdown/libssh2/commit/7e7189e013db15c6306fab0ddb38c020c0de81ed