Bug 1687305 (CVE-2019-3857)

Summary: CVE-2019-3857 libssh2: Integer overflow in SSH packet processing channel resulting in out of bounds write
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: bmcclain, dblechte, dfediuck, djuran, eedri, erik-fedora, kdudka, mgoldboi, michal.skrivanek, mike, paul, rjones, rschiron, sbonazzo, security-response-team, sherold, yturgema
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libssh2 1.8.1 Doc Type: If docs needed, set a value
Doc Text:
An integer overflow flaw which could lead to an out of bounds write was discovered in libssh2 in the way SSH_MSG_CHANNEL_REQUEST packets with an exit signal 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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 10:50:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1688181, 1688182, 1688426, 1688427, 1690247, 1690248, 1690408, 1694993, 1696058, 1697684, 1697694, 1714650, 1719437, 1719438, 1724837    
Bug Blocks: 1687317    

Description Andrej Nemec 2019-03-11 08:55:00 UTC
A server could send a SSH_MSG_CHANNEL_REQUEST packet with an exit signal message
with a length of max unsigned integer value. The length would then have a value
of 1 added to it and used to allocate memory causing a possible memory write out
of bounds error or zero byte allocation.

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

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

Comment 4 Riccardo Schirone 2019-03-13 10:37:19 UTC
Function _libssh2_packet_add() in packet.c does not properly check the namelen value of a SSH_MSG_CHANNEL_REQUEST message, with an exit signal. The value could overflow and is used to allocate memory later on.

Comment 5 Riccardo Schirone 2019-03-13 10:37:48 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 11 Doran Moppert 2019-03-19 04:41:10 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 13 Dhananjay Arunesh 2019-03-19 06:29:35 UTC
External References:

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

Comment 14 Dhananjay Arunesh 2019-03-19 06:47:55 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 15 Dhananjay Arunesh 2019-03-19 06:49:22 UTC
Created mingw-libssh2 tracking bugs for this issue:

Affects: epel-7 [bug 1690248]

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

Affects: fedora-all [bug 1690408]

Comment 22 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 26 errata-xmlrpc 2019-05-14 18:13:43 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

Comment 30 errata-xmlrpc 2019-07-02 11:44:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

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

Comment 31 errata-xmlrpc 2019-07-16 13:45:34 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.5 Extended Update Support

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

Comment 32 errata-xmlrpc 2019-07-30 09:08:19 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.4 Extended Update Support

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

Comment 33 errata-xmlrpc 2019-08-07 11:35:29 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.3 Advanced Update Support
  Red Hat Enterprise Linux 7.3 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.3 Telco Extended Update Support

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