Blame SOURCES/0007-libssh2-1.8.0-CVE-2019-3861.patch

eb5047
From 77bc71f4ca2949a11110092034dd0705faa6d7b5 Mon Sep 17 00:00:00 2001
eb5047
From: Kamil Dudka <kdudka@redhat.com>
eb5047
Date: Tue, 19 Mar 2019 13:43:34 +0100
eb5047
Subject: [PATCH] Resolves: CVE-2019-3861 - fix out-of-bounds reads with
eb5047
 specially crafted SSH packets
eb5047
eb5047
Upstream-Patch: https://libssh2.org/1.8.0-CVE/CVE-2019-3861.patch
eb5047
---
eb5047
 src/transport.c | 3 +++
eb5047
 1 file changed, 3 insertions(+)
eb5047
eb5047
diff --git a/src/transport.c b/src/transport.c
eb5047
index 5349284..6224c4f 100644
eb5047
--- a/src/transport.c
eb5047
+++ b/src/transport.c
eb5047
@@ -442,6 +442,9 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
eb5047
             }
eb5047
 
eb5047
             p->padding_length = block[4];
eb5047
+            if ( p->padding_length > p->packet_length - 1 ) {
eb5047
+                return LIBSSH2_ERROR_DECRYPT;
eb5047
+            }
eb5047
 
eb5047
             /* total_num is the number of bytes following the initial
eb5047
                (5 bytes) packet length and padding length fields */
eb5047
-- 
eb5047
2.17.2
eb5047