Skip to content

Commit c222644

Browse files
[AutoPR- Security] Patch libssh for CVE-2025-8114 [MEDIUM] (microsoft#15065)
1 parent 1e446f1 commit c222644

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

SPECS/libssh/CVE-2025-8114.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From 593fa4de0aee1cc61ed78446fd2a914846abf374 Mon Sep 17 00:00:00 2001
2+
From: Andreas Schneider <[email protected]>
3+
Date: Wed, 6 Aug 2025 15:17:59 +0200
4+
Subject: [PATCH] CVE-2025-8114: Fix NULL pointer dereference after allocation
5+
failure
6+
7+
Signed-off-by: Andreas Schneider <[email protected]>
8+
Reviewed-by: Jakub Jelen <[email protected]>
9+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
10+
Upstream-reference: https://git.libssh.org/projects/libssh.git/patch/?id=53ac23ded4cb2c5463f6c4cd1525331bd578812d
11+
---
12+
src/kex.c | 4 ++++
13+
1 file changed, 4 insertions(+)
14+
15+
diff --git a/src/kex.c b/src/kex.c
16+
index ecfc012..e88908b 100644
17+
--- a/src/kex.c
18+
+++ b/src/kex.c
19+
@@ -1391,6 +1391,8 @@ int ssh_make_sessionid(ssh_session session)
20+
ssh_log_hexdump("hash buffer", ssh_buffer_get(buf), ssh_buffer_get_len(buf));
21+
#endif
22+
23+
+ /* Set rc for the following switch statement in case we goto error. */
24+
+ rc = SSH_ERROR;
25+
switch (session->next_crypto->kex_type) {
26+
case SSH_KEX_DH_GROUP1_SHA1:
27+
case SSH_KEX_DH_GROUP14_SHA1:
28+
@@ -1450,6 +1452,7 @@ int ssh_make_sessionid(ssh_session session)
29+
session->next_crypto->secret_hash);
30+
break;
31+
}
32+
+
33+
/* During the first kex, secret hash and session ID are equal. However, after
34+
* a key re-exchange, a new secret hash is calculated. This hash will not replace
35+
* but complement existing session id.
36+
@@ -1458,6 +1461,7 @@ int ssh_make_sessionid(ssh_session session)
37+
session->next_crypto->session_id = malloc(session->next_crypto->digest_len);
38+
if (session->next_crypto->session_id == NULL) {
39+
ssh_set_error_oom(session);
40+
+ rc = SSH_ERROR;
41+
goto error;
42+
}
43+
memcpy(session->next_crypto->session_id, session->next_crypto->secret_hash,
44+
--
45+
2.45.4
46+

SPECS/libssh/libssh.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Vendor: Microsoft Corporation
22
Distribution: Mariner
33
Name: libssh
44
Version: 0.10.6
5-
Release: 4%{?dist}
5+
Release: 5%{?dist}
66
Summary: A library implementing the SSH protocol
77
License: LGPLv2+
88
URL: http://www.libssh.org
@@ -18,6 +18,7 @@ Patch2: CVE-2025-5351.patch
1818
Patch3: CVE-2025-5318.patch
1919
Patch4: CVE-2025-4878.patch
2020
Patch5: CVE-2025-8277.patch
21+
Patch6: CVE-2025-8114.patch
2122

2223
BuildRequires: cmake
2324
BuildRequires: gcc-c++
@@ -151,6 +152,9 @@ popd
151152
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/libssh/libssh_server.config
152153

153154
%changelog
155+
* Wed Nov 12 2025 Azure Linux Security Servicing Account <[email protected]> - 0.10.6-5
156+
- Patch for CVE-2025-8114
157+
154158
* Thu Sep 11 2025 Azure Linux Security Servicing Account <[email protected]> - 0.10.6-4
155159
- Patch for CVE-2025-8277
156160

0 commit comments

Comments
 (0)