Bug 1687304 (CVE-2019-3856) - CVE-2019-3856 libssh2: Integer overflow in keyboard interactive handling resulting in out of bounds write
Summary: CVE-2019-3856 libssh2: Integer overflow in keyboard interactive handling resu...
Status: NEW
Alias: CVE-2019-3856
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=important,public=20190313,repo...
Keywords: Security
Depends On: 1688164 1688423 1690247 1690248 1694992 1697694 1688163 1688424 1690408 1696058 1697684
Blocks: 1687317
TreeView+ depends on / blocked
 
Reported: 2019-03-11 08:53 UTC by Andrej Nemec
Modified: 2019-05-14 18:13 UTC (History)
17 users (show)

(edit)
An integer overflow flaw, which could lead to an out of bounds write, was discovered in libssh2 in the way keyboard prompt requests are parsed. 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.
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0960 None None None 2019-05-01 17:22 UTC
Red Hat Product Errata RHBA-2019:1141 None None None 2019-05-09 21:18 UTC
Red Hat Product Errata RHSA-2019:0679 None None None 2019-03-28 15:24 UTC
Red Hat Product Errata RHSA-2019:1175 None None None 2019-05-14 18:13 UTC

Description Andrej Nemec 2019-03-11 08:53:49 UTC
A server could send a value approching unsinged int max number of keyboard
prompt requests which could result in an unchecked interger overflow. The value
would then be used to allocate memory causing a possible memory write out of
bounds error.

Comment 2 Andrej Nemec 2019-03-12 09:15:08 UTC
Acknowledgments:

Name: the libssh2 project
Upstream: Chris Coulson (Canonical Ltd.)

Comment 3 Riccardo Schirone 2019-03-13 10:01:49 UTC
Function userauth_keyboard_interactive() in userauth.c does not properly check the number of prompts sent by the server and it uses the value in a computation that could result in an integer overflow. The result would then be used to allocate memory and can allow writing beyond the limits of the allocated buffer.

Comment 4 Riccardo Schirone 2019-03-13 10:02:44 UTC
The attacker needs to:
- trick the user to connect to a malicious server or
- trick the user to connect to a compromised server or
- intercept and modify the traffic

For these reasons User Interaction (UI) is set to Required(R) and Attack Complexity (AC) is set to High (H).

Comment 8 Riccardo Schirone 2019-03-14 15:05:26 UTC
The flaw can be triggered only on 32bit architectures or when the program is compiled against the 32bit version of the libssh2 library. The unchecked operations involve a size_t operand the number of prompts, stored in a uint32_t variable. On 64bit architectures, where size_t is 8 bytes long, the 4 bytes that represent the number of prompts and that are controlled by the attacker cannot make the multiplication overflow.

Comment 12 Doran Moppert 2019-03-19 04:41:03 UTC
Statement:

This flaw was present in libssh2 packages included in Red Hat Virtualization Hypervisor and Management Appliance, however libssh2 in these hosts is never exposed to malicious clients or servers.

Comment 14 Dhananjay Arunesh 2019-03-19 06:27:15 UTC
External References:

https://www.libssh2.org/CVE-2019-3856.html

Comment 15 Dhananjay Arunesh 2019-03-19 06:47:04 UTC
Created libssh tracking bugs for this issue:

Affects: fedora-all [bug 1690246]


Created mingw-libssh2 tracking bugs for this issue:

Affects: fedora-all [bug 1690247]

Comment 16 Dhananjay Arunesh 2019-03-19 06:48:36 UTC
Created mingw-libssh2 tracking bugs for this issue:

Affects: epel-7 [bug 1690248]

Comment 17 Andrej Nemec 2019-03-19 12:28:35 UTC
Created libssh2 tracking bugs for this issue:

Affects: fedora-all [bug 1690408]

Comment 18 errata-xmlrpc 2019-03-28 15:24:19 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:0679 https://access.redhat.com/errata/RHSA-2019:0679

Comment 22 errata-xmlrpc 2019-05-14 18:13:39 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2019:1175 https://access.redhat.com/errata/RHSA-2019:1175


Note You need to log in before you can comment on or make changes to this bug.