Skip to contentSkip to conversation

libssh: Fix CVE-2026-3731

PATCH New Vijay Anusuri 1 participant 1 message Mar 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libssh: Fix CVE-2026-3731

Pick commits according to [1]

[1] https://security-tracker.debian.org/tracker/CVE-2026-3731
[2] https://www.libssh.org/security/advisories/libssh-2026-sftp-extensions.txt

---
 .../libssh/libssh/CVE-2026-3731-1.patch       |  44 ++++++++
 .../libssh/libssh/CVE-2026-3731-2.patch       | 102 ++++++++++++++++++
 .../recipes-support/libssh/libssh_0.10.6.bb   |   2 +
 3 files changed, 148 insertions(+)
 create mode 100644 meta-oe/recipes-support/libssh/libssh/CVE-2026-3731-1.patch
 create mode 100644 meta-oe/recipes-support/libssh/libssh/CVE-2026-3731-2.patch
meta-oe/recipes-support/libssh/libssh/CVE-2026-3731-1.patch new file +44 -0
new file mode 100644
index 0000000000..69a012d294
@@ -0,0 +1,44 @@
+From f80670a7aba86cbb442c9b115c9eaf4ca04601b8 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <[email protected]>
+Date: Thu, 11 Dec 2025 13:22:44 +0100
+Subject: [PATCH] sftp: Fix out-of-bound read from sftp extensions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Jakub Jelen <[email protected]>
+Reviewed-by: Pavol Žáčik <[email protected]>
+(cherry picked from commit 855a0853ad3abd4a6cd85ce06fce6d8d4c7a0b60)
+
+Upstream-Status: Backport [https://git.libssh.org/projects/libssh.git/commit/?id=f80670a7aba86cbb442c9b115c9eaf4ca04601b8]
+CVE: CVE-2026-3731
+Signed-off-by: Vijay Anusuri <[email protected]>
+---
+ src/sftp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/sftp.c b/src/sftp.c
+index e01012a8..4a77141b 100644
+--- a/src/sftp.c
++++ b/src/sftp.c
+@@ -768,7 +768,7 @@ const char *sftp_extensions_get_name(sftp_session sftp, unsigned int idx) {
+     return NULL;
+   }
+ 
+-  if (idx > sftp->ext->count) {
++  if (idx >= sftp->ext->count) {
+     ssh_set_error_invalid(sftp->session);
+     return NULL;
+   }
+@@ -784,7 +784,7 @@ const char *sftp_extensions_get_data(sftp_session sftp, unsigned int idx) {
+     return NULL;
+   }
+ 
+-  if (idx > sftp->ext->count) {
++  if (idx >= sftp->ext->count) {
+     ssh_set_error_invalid(sftp->session);
+     return NULL;
+   }
+-- 
+2.43.0
+
meta-oe/recipes-support/libssh/libssh/CVE-2026-3731-2.patch new file +102 -0

102 lines not on this page · raw message

meta-oe/recipes-support/libssh/libssh_0.10.6.bb +2 -0
index de37719b09..614b656216 100644
@@ -22,6 +22,8 @@ SRC_URI = "git://git.libssh.org/projects/libssh.git;protocol=https;branch=stable
            file://CVE-2025-8277-2.patch \
            file://CVE-2025-8277-3.patch \
            file://CVE-2025-8277-4.patch \
+           file://CVE-2026-3731-1.patch \
+           file://CVE-2026-3731-2.patch \
           "
 SRCREV = "10e09e273f69e149389b3e0e5d44b8c221c2e7f6"
 
Signature · 1 line
2.43.0