Bug 1687303 (CVE-2019-3855)

Summary: CVE-2019-3855 libssh2: Integer overflow in transport read 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, ddepaula, dfediuck, djuran, eedri, erik-fedora, jen, kdudka, mgoldboi, michal.skrivanek, mike, paul, rjones, rschiron, sbonazzo, security-response-team, sherold, thoger, yturgema
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=important,public=20190313,reported=20190308,source=distros,cvss3=7.5/CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H,cwe=CWE-190->CWE-787,fedora-all/libssh2=affected,fedora-all/mingw-libssh2=affected,epel-7/mingw-libssh2=affected,rhel-6/libssh2=affected,rhel-7/libssh2=affected,openshift-online-3/libssh2=affected,rhel-8/virt:rhel/libssh2=affected,rhel-br-8/virt-devel:rhel/libssh2=affected,rhev-m-4/redhat-virtualization-host=wontfix/impact=low,rhev-m-4/rhvm-appliance=wontfix/impact=low,rhel-av-8/virt:8.0.0/libssh2=affected
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 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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 10:50:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 1688421, 1688422, 1690247, 1690248, 1694991, 1697694, 1688160, 1688161, 1690408, 1696058, 1697684, 1714646, 1719429, 1719430, 1724834    
Bug Blocks: 1687317    

Description Andrej Nemec 2019-03-11 08:52:40 UTC
A malicious server could send a specially crafted packet which could result in
an unchecked integer 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:00 UTC
Acknowledgments:

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

Comment 3 Riccardo Schirone 2019-03-13 09:49:36 UTC
Function _libssh2_transport_read() in transport.c does not properly check the packet_length received from the server. A malicious server could send a large packet_length value and cause an integer overflow when computing total_num, which would result in a buffer overflow later on.

Comment 4 Riccardo Schirone 2019-03-13 09:52:25 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 16 Doran Moppert 2019-03-19 04:40:44 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 17 Dhananjay Arunesh 2019-03-19 06:23:32 UTC
Upstream Patch:
https://libssh2.org/1.8.0-CVE/CVE-2019-3855.patch

Comment 18 Dhananjay Arunesh 2019-03-19 06:23:35 UTC
External References:

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

Comment 19 Dhananjay Arunesh 2019-03-19 06:25:09 UTC
Reference:
https://www.openwall.com/lists/oss-security/2019/03/18/3

Comment 20 Dhananjay Arunesh 2019-03-19 06:47:36 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 21 Dhananjay Arunesh 2019-03-19 06:49:05 UTC
Created mingw-libssh2 tracking bugs for this issue:

Affects: epel-7 [bug 1690248]

Comment 23 Andrej Nemec 2019-03-19 12:27:58 UTC
Created libssh2 tracking bugs for this issue:

Affects: fedora-all [bug 1690408]

Comment 27 errata-xmlrpc 2019-03-28 15:24:17 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 37 errata-xmlrpc 2019-05-14 18:13:38 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 41 errata-xmlrpc 2019-07-02 11:44:55 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 42 errata-xmlrpc 2019-07-16 13:45:33 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 43 errata-xmlrpc 2019-07-30 09:08:17 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 44 errata-xmlrpc 2019-08-07 11:35:26 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