From: Stefan Mueller via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: "Stefan Müller" <stefan.mueller@rey-technology.com>
Subject: [Buildroot] [PATCH v2 2/5] package/libssh2: fix CVE-2026-66032
Date: Thu, 20 Aug 2026 07:32:05 +0000 [thread overview]
Message-ID: <20260820073208.376968-3-stemu86@gmx.ch> (raw)
In-Reply-To: <20260820073208.376968-1-stemu86@gmx.ch>
From: Stefan Müller <stefan.mueller@rey-technology.com>
Backport the fix for CVE-2026-66032.
A SFTP error path can leave a dangling pointer after freeing the
response buffer, which may result in a double free on subsequent error
handling.
Use Debian's libssh2 1.11.1 backport of the upstream fix.
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
---
Backport to: 2025.02.x
---
...-prevent-dangling-pointer-after-free.patch | 28 +++++++++++++++++++
package/libssh2/libssh2.mk | 3 ++
2 files changed, 31 insertions(+)
create mode 100644 package/libssh2/0007-sftp-prevent-dangling-pointer-after-free.patch
diff --git a/package/libssh2/0007-sftp-prevent-dangling-pointer-after-free.patch b/package/libssh2/0007-sftp-prevent-dangling-pointer-after-free.patch
new file mode 100644
index 0000000000..527365b33a
--- /dev/null
+++ b/package/libssh2/0007-sftp-prevent-dangling-pointer-after-free.patch
@@ -0,0 +1,28 @@
+From 5e4776146552d898b9c0e1b313cd093fa8dc92d0 Mon Sep 17 00:00:00 2001
+From: Will Cosgrove <will@panic.com>
+Date: Thu, 2 Jul 2026 11:00:23 -0700
+Subject: [PATCH] Prevent dangling pointer by nullifying data (#2180)
+
+Set data to NULL after freeing it to avoid dangling pointer. fixes
+GHSA-px3w-7g75-hg7w.
+
+Credit: VladimirEliTokarev
+Forwarded: not-needed
+
+CVE: CVE-2026-66032
+Upstream: https://github.com/libssh2/libssh2/commit/5e4776146552d898b9c0e1b313cd093fa8dc92d0
+Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
+---
+ src/sftp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/src/sftp.c
++++ b/src/sftp.c
+@@ -1279,6 +1279,7 @@
+ "got HANDLE FXOK"));
+
+ LIBSSH2_FREE(session, data);
++ data = NULL;
+
+ /* silly situation, but check for a HANDLE */
+ rc = sftp_packet_require(sftp, SSH_FXP_HANDLE,
diff --git a/package/libssh2/libssh2.mk b/package/libssh2/libssh2.mk
index 6b2d774b38..583ed56c1c 100644
--- a/package/libssh2/libssh2.mk
+++ b/package/libssh2/libssh2.mk
@@ -27,6 +27,9 @@ LIBSSH2_IGNORE_CVES += CVE-2026-55200
# 0006-sftp-symlink-fix-SSH_FXP_STATUS-response.patch
LIBSSH2_IGNORE_CVES += CVE-2025-15661
+# 0007-sftp-prevent-dangling-pointer-after-free.patch
+LIBSSH2_IGNORE_CVES += CVE-2026-66032
+
ifeq ($(BR2_PACKAGE_LIBSSH2_MBEDTLS),y)
LIBSSH2_DEPENDENCIES += mbedtls
LIBSSH2_CONF_OPTS += --with-libmbedcrypto-prefix=$(STAGING_DIR)/usr \
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-08-20 7:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 7:32 [Buildroot] [PATCH v2 0/5] package/libssh2: fix five security vulnerabilities Stefan Mueller via buildroot
2026-08-20 7:32 ` [Buildroot] [PATCH v2 1/5] package/libssh2: fix CVE-2025-15661 Stefan Mueller via buildroot
2026-08-22 22:02 ` Julien Olivain via buildroot
2026-08-20 7:32 ` Stefan Mueller via buildroot [this message]
2026-08-20 7:32 ` [Buildroot] [PATCH v2 3/5] package/libssh2: fix CVE-2026-66033 Stefan Mueller via buildroot
2026-08-20 7:32 ` [Buildroot] [PATCH v2 4/5] package/libssh2: fix CVE-2026-66034 Stefan Mueller via buildroot
2026-08-20 7:32 ` [Buildroot] [PATCH v2 5/5] package/libssh2: fix CVE-2026-66035 Stefan Mueller via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260820073208.376968-3-stemu86@gmx.ch \
--to=buildroot@buildroot.org \
--cc=stefan.mueller@rey-technology.com \
--cc=stemu86@gmx.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox