From 60a006422474f787962ecf18f5aba4cd14688676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= Date: Tue, 30 Sep 2025 10:01:57 +0200 Subject: [PATCH] Fix possible buffer overrun from CVE-2025-5318 Resolves: RHEL-111732 --- CVE-2025-5318.patch | 27 +++++++++++++++++++++++++++ libssh.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 CVE-2025-5318.patch diff --git a/CVE-2025-5318.patch b/CVE-2025-5318.patch new file mode 100644 index 0000000..fa645d7 --- /dev/null +++ b/CVE-2025-5318.patch @@ -0,0 +1,27 @@ +From a49bef98417bdfe302cfb2dc234cfd8e4bd1e38c Mon Sep 17 00:00:00 2001 +From: Jakub Jelen +Date: Tue, 22 Apr 2025 21:18:44 +0200 +Subject: [PATCH] CVE-2025-5318: sftpserver: Fix possible buffer overrun + +Signed-off-by: Jakub Jelen +Reviewed-by: Andreas Schneider +--- + src/sftpserver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sftpserver.c b/src/sftpserver.c +index 9117f155..b3349e16 100644 +--- a/src/sftpserver.c ++++ b/src/sftpserver.c +@@ -538,7 +538,7 @@ void *sftp_handle(sftp_session sftp, ssh_string handle){ + + memcpy(&val, ssh_string_data(handle), sizeof(uint32_t)); + +- if (val > SFTP_HANDLES) { ++ if (val >= SFTP_HANDLES) { + return NULL; + } + +-- +2.50.1 + diff --git a/libssh.spec b/libssh.spec index b1e730b..c1e9903 100644 --- a/libssh.spec +++ b/libssh.spec @@ -1,6 +1,6 @@ Name: libssh Version: 0.10.4 -Release: 13%{?dist} +Release: 14%{?dist} Summary: A library implementing the SSH protocol License: LGPLv2+ URL: http://www.libssh.org @@ -55,6 +55,7 @@ Patch13: CVE-2023-6004.patch Patch14: CVE-2023-48795.patch Patch15: CVE-2023-6918.patch Patch16: escape-brackets-in-proxycommand.patch +Patch17: CVE-2025-5318.patch %description The ssh library was designed to be used by programmers needing a working SSH @@ -147,6 +148,10 @@ popd %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/libssh/libssh_server.config %changelog +* Tue Sep 30 2025 Pavol Žáčik - 0.10.4-14 +- Fix CVE-2025-5318 + Resolves: RHEL-111732 + * Mon Feb 19 2024 Sahana Prasad - 0.10.4-13 - Bump up the version so that the version in 9.3 is lower. - Resolves: RHEL-19310, RHEL-19691, RHEL-17245