Initial Commit
- initial default booting image
This commit is contained in:
57
package/libssh2/0001-username-len-bound-checking.patch
Normal file
57
package/libssh2/0001-username-len-bound-checking.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
From 256d04b60d80bf1190e96b0ad1e91b2174d744b1 Mon Sep 17 00:00:00 2001
|
||||
From: Will Cosgrove <will@panic.com>
|
||||
Date: Mon, 13 Apr 2026 11:18:25 -0700
|
||||
Subject: [PATCH] userauth.c: username_len bounds checking (#1858)
|
||||
|
||||
Return errors when username_len will exceed bounds, fix existing bounds
|
||||
check.
|
||||
|
||||
Credit:
|
||||
[dapickle](https://github.com/dapickle)
|
||||
|
||||
CVE: CVE-2026-7598
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/256d04b60d80bf1190e96b0ad1e91b2174d744b1
|
||||
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
||||
---
|
||||
src/userauth.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/userauth.c b/src/userauth.c
|
||||
index f8e02651..43d9ab9b 100644
|
||||
--- a/src/userauth.c
|
||||
+++ b/src/userauth.c
|
||||
@@ -80,6 +80,12 @@ static char *userauth_list(LIBSSH2_SESSION *session, const char *username,
|
||||
memset(&session->userauth_list_packet_requirev_state, 0,
|
||||
sizeof(session->userauth_list_packet_requirev_state));
|
||||
|
||||
+ if(username_len > UINT32_MAX - 27) {
|
||||
+ _libssh2_error(session, LIBSSH2_ERROR_PROTO,
|
||||
+ "username_len out of bounds");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
session->userauth_list_data_len = username_len + 27;
|
||||
|
||||
s = session->userauth_list_data =
|
||||
@@ -307,6 +313,11 @@ userauth_password(LIBSSH2_SESSION *session,
|
||||
* 40 = packet_type(1) + username_len(4) + service_len(4) +
|
||||
* service(14)"ssh-connection" + method_len(4) + method(8)"password" +
|
||||
* chgpwdbool(1) + password_len(4) */
|
||||
+ if(username_len > UINT32_MAX - 40) {
|
||||
+ return _libssh2_error(session, LIBSSH2_ERROR_PROTO,
|
||||
+ "username_len out of bounds");
|
||||
+ }
|
||||
+
|
||||
session->userauth_pswd_data_len = username_len + 40;
|
||||
|
||||
session->userauth_pswd_data0 =
|
||||
@@ -447,7 +458,7 @@ password_response:
|
||||
}
|
||||
|
||||
/* basic data_len + newpw_len(4) */
|
||||
- if(username_len + password_len + 44 <= UINT_MAX) {
|
||||
+ if(username_len <= UINT32_MAX - password_len - 44) {
|
||||
session->userauth_pswd_data_len =
|
||||
username_len + password_len + 44;
|
||||
s = session->userauth_pswd_data =
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 17626857d20b3c9a1addfa45979dadcee1cd84a4 Mon Sep 17 00:00:00 2001
|
||||
From: TristanInSec <tristan.mtn@gmail.com>
|
||||
Date: Wed, 15 Apr 2026 14:51:08 -0400
|
||||
Subject: [PATCH] packet: check `_libssh2_get_string()` return in `EXT_INFO`
|
||||
handler
|
||||
|
||||
The `SSH_MSG_EXT_INFO` handler discards the return values from
|
||||
`_libssh2_get_string()` when parsing extension name/value pairs. When
|
||||
the buffer is exhausted before all claimed extensions are parsed,
|
||||
the loop continues with no-op iterations until `nr_extensions` reaches
|
||||
zero.
|
||||
|
||||
The `nr_extensions >= 1024` cap limits the worst case, but the loop
|
||||
should still break on parse failure for correctness and consistency
|
||||
with other parsers in this file (e.g. `SSH_MSG_CHANNEL_OPEN`,
|
||||
`SSH_MSG_KEXINIT`) that check `_libssh2_get_string()` return values.
|
||||
|
||||
Closes #1864
|
||||
|
||||
CVE: CVE-2026-55199
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/17626857d20b3c9a1addfa45979dadcee1cd84a4
|
||||
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
||||
---
|
||||
src/packet.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/packet.c b/src/packet.c
|
||||
index ae86365d2a..8a7a0d2690 100644
|
||||
--- a/src/packet.c
|
||||
+++ b/src/packet.c
|
||||
@@ -868,8 +868,10 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
|
||||
|
||||
nr_extensions -= 1;
|
||||
|
||||
- _libssh2_get_string(&buf, &name, &name_len);
|
||||
- _libssh2_get_string(&buf, &value, &value_len);
|
||||
+ if(_libssh2_get_string(&buf, &name, &name_len))
|
||||
+ break;
|
||||
+ if(_libssh2_get_string(&buf, &value, &value_len))
|
||||
+ break;
|
||||
|
||||
if(name && value) {
|
||||
_libssh2_debug((session,
|
||||
@@ -0,0 +1,36 @@
|
||||
From 97acf3dfda80c91c3a8c9f2372546301d4a1a7a8 Mon Sep 17 00:00:00 2001
|
||||
From: Will Cosgrove <will@panic.com>
|
||||
Date: Fri, 12 Jun 2026 15:57:44 -0700
|
||||
Subject: [PATCH] transport.c: Additional boundary checks for packet length
|
||||
(#2052)
|
||||
|
||||
Add additional bounds checking on packet length to prevent OOB write.
|
||||
|
||||
Credit: [TristanInSec](https://github.com/TristanInSec)
|
||||
|
||||
CVE: CVE-2026-55200
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/97acf3dfda80c91c3a8c9f2372546301d4a1a7a8
|
||||
[thomas: backport to 1.11.1, change ntohu32 call]
|
||||
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
||||
---
|
||||
src/transport.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/transport.c b/src/transport.c
|
||||
index 869fc5a4fa..7925ad33d1 100644
|
||||
--- a/src/transport.c
|
||||
+++ b/src/transport.c
|
||||
@@ -645,8 +645,12 @@ int ssh2_transport_read(LIBSSH2_SESSION *session)
|
||||
total_num = 4;
|
||||
|
||||
p->packet_length = _libssh2_ntohu32(block);
|
||||
- if(p->packet_length < 1)
|
||||
+ if(p->packet_length < 1) {
|
||||
return LIBSSH2_ERROR_DECRYPT;
|
||||
+ }
|
||||
+ else if(p->packet_length > LIBSSH2_PACKET_MAXPAYLOAD) {
|
||||
+ return LIBSSH2_ERROR_OUT_OF_BOUNDARY;
|
||||
+ }
|
||||
|
||||
/* total_num may include size field, however due to existing
|
||||
* logic it needs to be removed after the entire packet is read
|
||||
117
package/libssh2/0004-sftp-symlink-fix-out-of-bounds-read.patch
Normal file
117
package/libssh2/0004-sftp-symlink-fix-out-of-bounds-read.patch
Normal file
@@ -0,0 +1,117 @@
|
||||
From 2dae3024897e1898d389835151f4e9606227721d Mon Sep 17 00:00:00 2001
|
||||
From: Will Cosgrove <will@panic.com>
|
||||
Date: Fri, 10 Oct 2025 08:26:20 -0700
|
||||
Subject: [PATCH] Update sftp_symlink to avoid out of bounds read on malformed
|
||||
packet #1705 (#1717)
|
||||
|
||||
|
||||
CVE: CVE-2025-15661
|
||||
Upstream: https://sources.debian.org/patches/libssh2/1.11.1-6/CVE-2025-15661.patch/
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/2dae3024897e1898d389835151f4e9606227721d
|
||||
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
|
||||
---
|
||||
--- libssh2-1.11.1.orig/src/sftp.c
|
||||
+++ libssh2-1.11.1/src/sftp.c
|
||||
@@ -3795,15 +3795,19 @@ static int sftp_symlink(LIBSSH2_SFTP *sf
|
||||
{
|
||||
LIBSSH2_CHANNEL *channel = sftp->channel;
|
||||
LIBSSH2_SESSION *session = channel->session;
|
||||
- size_t data_len = 0, link_len;
|
||||
+ size_t data_len = 0, lk_len;
|
||||
/* 13 = packet_len(4) + packet_type(1) + request_id(4) + path_len(4) */
|
||||
ssize_t packet_len =
|
||||
path_len + 13 +
|
||||
((link_type == LIBSSH2_SFTP_SYMLINK) ? (4 + target_len) : 0);
|
||||
unsigned char *s, *data = NULL;
|
||||
+ struct string_buf buf;
|
||||
static const unsigned char link_responses[2] =
|
||||
{ SSH_FXP_NAME, SSH_FXP_STATUS };
|
||||
int retcode;
|
||||
+ unsigned char packet_type;
|
||||
+ uint32_t tmp_u32;
|
||||
+ unsigned char *lk_target;
|
||||
|
||||
if(sftp->symlink_state == libssh2_NB_state_idle) {
|
||||
sftp->last_errno = LIBSSH2_FX_OK;
|
||||
@@ -3891,8 +3895,25 @@ static int sftp_symlink(LIBSSH2_SFTP *sf
|
||||
|
||||
sftp->symlink_state = libssh2_NB_state_idle;
|
||||
|
||||
- if(data[0] == SSH_FXP_STATUS) {
|
||||
- retcode = _libssh2_ntohu32(data + 5);
|
||||
+ buf.data = (unsigned char *)LIBSSH2_UNCONST(data);
|
||||
+ buf.dataptr = buf.data;
|
||||
+ buf.len = data_len;
|
||||
+
|
||||
+ if(_libssh2_get_byte(&buf, &packet_type)) {
|
||||
+ LIBSSH2_FREE(session, data);
|
||||
+ return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||
+ "SFTP Protocol Error (type)");
|
||||
+ }
|
||||
+
|
||||
+ if(packet_type == SSH_FXP_STATUS) {
|
||||
+ if(_libssh2_get_u32(&buf, &tmp_u32)) {
|
||||
+ LIBSSH2_FREE(session, data);
|
||||
+ return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||
+ "SFTP Protocol Error (code)");
|
||||
+ }
|
||||
+
|
||||
+ retcode = (int)tmp_u32;
|
||||
+
|
||||
LIBSSH2_FREE(session, data);
|
||||
if(retcode == LIBSSH2_FX_OK)
|
||||
return LIBSSH2_ERROR_NONE;
|
||||
@@ -3903,30 +3924,37 @@ static int sftp_symlink(LIBSSH2_SFTP *sf
|
||||
}
|
||||
}
|
||||
|
||||
- if(_libssh2_ntohu32(data + 5) < 1) {
|
||||
+ /* advance past id */
|
||||
+ if(_libssh2_get_u32(&buf, &tmp_u32)) {
|
||||
LIBSSH2_FREE(session, data);
|
||||
return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||
- "Invalid READLINK/REALPATH response, "
|
||||
- "no name entries");
|
||||
+ "SFTP Protocol Error (id)");
|
||||
}
|
||||
|
||||
- if(data_len < 13) {
|
||||
- if(data_len > 0) {
|
||||
- LIBSSH2_FREE(session, data);
|
||||
- }
|
||||
+ /* look for at least one link */
|
||||
+ if(_libssh2_get_u32(&buf, &tmp_u32) || tmp_u32 < 1) {
|
||||
+ LIBSSH2_FREE(session, data);
|
||||
return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||
- "SFTP stat packet too short");
|
||||
+ "Invalid READLINK/REALPATH response, "
|
||||
+ "no name entries");
|
||||
}
|
||||
|
||||
- /* this reads a u32 and stores it into a signed 32bit value */
|
||||
- link_len = _libssh2_ntohu32(data + 9);
|
||||
- if(link_len < target_len) {
|
||||
- memcpy(target, data + 13, link_len);
|
||||
- target[link_len] = 0;
|
||||
- retcode = (int)link_len;
|
||||
+ if(_libssh2_get_string(&buf, &lk_target, &lk_len) == LIBSSH2_ERROR_NONE) {
|
||||
+ if(lk_len < target_len) {
|
||||
+ memcpy(target, lk_target, lk_len);
|
||||
+ target[lk_len] = '\0';
|
||||
+ retcode = (int)lk_len;
|
||||
+ }
|
||||
+ else {
|
||||
+ retcode = LIBSSH2_ERROR_BUFFER_TOO_SMALL;
|
||||
+ }
|
||||
}
|
||||
- else
|
||||
- retcode = LIBSSH2_ERROR_BUFFER_TOO_SMALL;
|
||||
+ else {
|
||||
+ LIBSSH2_FREE(session, data);
|
||||
+ return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||
+ "SFTP Protocol Error (filename)");
|
||||
+ }
|
||||
+
|
||||
LIBSSH2_FREE(session, data);
|
||||
|
||||
return retcode;
|
||||
@@ -0,0 +1,30 @@
|
||||
Needed by the fix for CVE-2025-15661
|
||||
|
||||
Cherrypicked from
|
||||
commit 606c102e52f8447de2b745dd6c5ddf418defc519
|
||||
Author: Viktor Szakats <commit@vsz.me>
|
||||
Date: Thu Jan 30 21:18:23 2025 +0100
|
||||
|
||||
|
||||
CVE: CVE-2025-15661
|
||||
Upstream: https://sources.debian.org/patches/libssh2/1.11.1-6/libssh-unconst-backport.patch/
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/606c102e52f8447de2b745dd6c5ddf418defc519
|
||||
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
|
||||
---
|
||||
--- libssh2-1.11.1.orig/src/libssh2_priv.h
|
||||
+++ libssh2-1.11.1/src/libssh2_priv.h
|
||||
@@ -117,6 +117,14 @@
|
||||
#define UINT32_MAX 0xffffffffU
|
||||
#endif
|
||||
|
||||
+#ifdef _WIN64
|
||||
+#define LIBSSH2_UNCONST(p) ((void *)(libssh2_uint64_t)(const void *)(p))
|
||||
+#elif defined(_MSC_VER)
|
||||
+#define LIBSSH2_UNCONST(p) ((void *)(unsigned int)(const void *)(p))
|
||||
+#else
|
||||
+#define LIBSSH2_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
|
||||
+#endif
|
||||
+
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && \
|
||||
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
|
||||
!defined(LIBSSH2_NO_FMT_CHECKS)
|
||||
@@ -0,0 +1,46 @@
|
||||
From 4ed26f5740bdd409269ed9fb48a28bf8f565b681 Mon Sep 17 00:00:00 2001
|
||||
From: Will Cosgrove <will@panic.com>
|
||||
Date: Mon, 20 Oct 2025 14:04:52 -0700
|
||||
Subject: [PATCH] Fix sftp_symlink when getting SSH_FXP_STATUS response (#1731)
|
||||
|
||||
Move advancing past packet ID before reading the FXP_STATUS response.
|
||||
|
||||
CVE: CVE-2025-15661
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/4ed26f5740bdd409269ed9fb48a28bf8f565b681
|
||||
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
|
||||
---
|
||||
src/sftp.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/sftp.c b/src/sftp.c
|
||||
index 70d7686daf..bb297b831a 100644
|
||||
--- a/src/sftp.c
|
||||
+++ b/src/sftp.c
|
||||
@@ -4006,6 +4006,13 @@ static int sftp_symlink(LIBSSH2_SFTP *sftp, const char *path,
|
||||
"SFTP Protocol Error (type)");
|
||||
}
|
||||
|
||||
+ /* advance past id */
|
||||
+ if(_libssh2_get_u32(&buf, &tmp_u32)) {
|
||||
+ LIBSSH2_FREE(session, data);
|
||||
+ return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||
+ "SFTP Protocol Error (id)");
|
||||
+ }
|
||||
+
|
||||
if(packet_type == SSH_FXP_STATUS) {
|
||||
if(_libssh2_get_u32(&buf, &tmp_u32)) {
|
||||
LIBSSH2_FREE(session, data);
|
||||
@@ -4025,13 +4032,6 @@ static int sftp_symlink(LIBSSH2_SFTP *sftp, const char *path,
|
||||
}
|
||||
}
|
||||
|
||||
- /* advance past id */
|
||||
- if(_libssh2_get_u32(&buf, &tmp_u32)) {
|
||||
- LIBSSH2_FREE(session, data);
|
||||
- return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL,
|
||||
- "SFTP Protocol Error (id)");
|
||||
- }
|
||||
-
|
||||
/* look for at least one link */
|
||||
if(_libssh2_get_u32(&buf, &tmp_u32) || tmp_u32 < 1) {
|
||||
LIBSSH2_FREE(session, data);
|
||||
@@ -0,0 +1,29 @@
|
||||
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://sources.debian.org/patches/libssh2/1.11.1-6/CVE-2026-66032.patch/
|
||||
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,
|
||||
45
package/libssh2/0008-openssl-fix-AES-GCM-bounds-checks.patch
Normal file
45
package/libssh2/0008-openssl-fix-AES-GCM-bounds-checks.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From a2ed82d40964bbc0d64cd717aa0a5a892117d2e6 Mon Sep 17 00:00:00 2001
|
||||
From: Viktor Szakats <commit@vsz.me>
|
||||
Date: Thu, 23 Jul 2026 10:32:04 +0200
|
||||
Subject: [PATCH] openssl: fix potential OOB read/write with AES-GCM in
|
||||
`ssh2_cipher_crypt()`
|
||||
|
||||
By applying two bounds checks to non-debug builds.
|
||||
|
||||
Reported-by: Vladimir Eli Tokarev
|
||||
Fixes GHSA-c4f7-cvfc-33j7
|
||||
Follow-up to 3c953c05d67eb1ebcfd3316f279f12c4b1d600b4 #797
|
||||
|
||||
Closes #2401
|
||||
Forwarded: not-needed
|
||||
|
||||
CVE: CVE-2026-66033
|
||||
Upstream: https://sources.debian.org/patches/libssh2/1.11.1-6/CVE-2026-66033.patch/
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/a2ed82d40964bbc0d64cd717aa0a5a892117d2e6
|
||||
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
|
||||
---
|
||||
src/openssl.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/src/openssl.c
|
||||
+++ b/src/openssl.c
|
||||
@@ -1042,13 +1042,15 @@
|
||||
const int aadlen = (is_aesgcm && IS_FIRST(firstlast)) ? 4 : 0;
|
||||
/* size of AT, if present */
|
||||
const int authenticationtag = IS_LAST(firstlast) ? authlen : 0;
|
||||
- /* length to encrypt */
|
||||
- const int cryptlen = (unsigned int)blocksize - aadlen - authenticationtag;
|
||||
+ unsigned int cryptlen; /* length to encrypt */
|
||||
|
||||
(void)algo;
|
||||
|
||||
- assert(blocksize <= sizeof(buf));
|
||||
- assert(cryptlen >= 0);
|
||||
+ if(blocksize > sizeof(buf) ||
|
||||
+ blocksize < (size_t)(aadlen + authenticationtag))
|
||||
+ return 1;
|
||||
+
|
||||
+ cryptlen = (unsigned int)blocksize - aadlen - authenticationtag;
|
||||
|
||||
#if LIBSSH2_AES_GCM
|
||||
/* First block */
|
||||
36
package/libssh2/0009-publickey-fix-potential-OOB-read.patch
Normal file
36
package/libssh2/0009-publickey-fix-potential-OOB-read.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From a13bb6c773f0d55ad1628cede57e99803cd898d9 Mon Sep 17 00:00:00 2001
|
||||
From: Viktor Szakats <commit@vsz.me>
|
||||
Date: Sat, 4 Jul 2026 11:19:49 +0200
|
||||
Subject: [PATCH] publickey: fix potential OOB read in
|
||||
`libssh2_publickey_list_fetch()`
|
||||
|
||||
Reported-by: Vladimir Eli Tokarev
|
||||
Fixes GHSA-w6g9-cpfp-22gc
|
||||
|
||||
Closes #2202
|
||||
Forwarded: not-needed
|
||||
|
||||
CVE: CVE-2026-66034
|
||||
Upstream: https://sources.debian.org/patches/libssh2/1.11.1-6/CVE-2026-66034.patch/
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/a13bb6c773f0d55ad1628cede57e99803cd898d9
|
||||
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
|
||||
---
|
||||
src/publickey.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
--- a/src/publickey.c
|
||||
+++ b/src/publickey.c
|
||||
@@ -988,6 +988,13 @@
|
||||
}
|
||||
|
||||
if(comment_len) {
|
||||
+ if(pkey->listFetch_s + comment_len >
|
||||
+ pkey->listFetch_data + pkey->listFetch_data_len) {
|
||||
+ _libssh2_error(session, LIBSSH2_ERROR_BUFFER_TOO_SMALL,
|
||||
+ "ListFetch data too short");
|
||||
+ goto err_exit;
|
||||
+ }
|
||||
+
|
||||
list[keys].num_attrs = 1;
|
||||
list[keys].attrs =
|
||||
LIBSSH2_ALLOC(session,
|
||||
@@ -0,0 +1,42 @@
|
||||
From 42e33d81577ed4b95d4b4f6f845e5ee8efe5eeb4 Mon Sep 17 00:00:00 2001
|
||||
From: Viktor Szakats <commit@vsz.me>
|
||||
Date: Fri, 3 Jul 2026 18:22:55 +0200
|
||||
Subject: [PATCH] transport: fix potential heap overflow on ETM decrypt
|
||||
|
||||
Reported-by: Vladimir Eli Tokarev
|
||||
Fixes GHSA-6c79-444r-wx26
|
||||
|
||||
Closes #2198
|
||||
Forwarded: not-needed
|
||||
|
||||
CVE: CVE-2026-66035
|
||||
Upstream: https://sources.debian.org/patches/libssh2/1.11.1-6/CVE-2026-66035.patch/
|
||||
Upstream: https://github.com/libssh2/libssh2/commit/42e33d81577ed4b95d4b4f6f845e5ee8efe5eeb4
|
||||
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
|
||||
---
|
||||
src/transport.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/transport.c
|
||||
+++ b/src/transport.c
|
||||
@@ -242,6 +242,12 @@
|
||||
unsigned char *decrypt_buffer;
|
||||
int blocksize = session->remote.crypt->blocksize;
|
||||
|
||||
+ if(p->total_num < mac_len + 4 + (size_t)blocksize) {
|
||||
+ LIBSSH2_FREE(session, p->payload);
|
||||
+ return LIBSSH2_ERROR_DECRYPT;
|
||||
+ }
|
||||
+ decrypt_size = (ssize_t)(p->total_num - mac_len - 4);
|
||||
+
|
||||
rc = decrypt(session, p->payload + 4,
|
||||
first_block, blocksize, FIRST_BLOCK);
|
||||
if(rc) {
|
||||
@@ -249,7 +255,6 @@
|
||||
}
|
||||
|
||||
/* we need buffer for decrypt */
|
||||
- decrypt_size = p->total_num - mac_len - 4;
|
||||
decrypt_buffer = LIBSSH2_ALLOC(session, decrypt_size);
|
||||
if(!decrypt_buffer) {
|
||||
return LIBSSH2_ERROR_ALLOC;
|
||||
33
package/libssh2/Config.in
Normal file
33
package/libssh2/Config.in
Normal file
@@ -0,0 +1,33 @@
|
||||
config BR2_PACKAGE_LIBSSH2
|
||||
bool "libssh2"
|
||||
select BR2_PACKAGE_OPENSSL if !(BR2_PACKAGE_MBEDTLS || BR2_PACKAGE_LIBGCRYPT)
|
||||
help
|
||||
libssh2 is a client-side C library implementing the SSH2
|
||||
protocol as defined by Internet Drafts: SECSH-TRANS(22),
|
||||
SECSH-USERAUTH(25), SECSH-CONNECTION(23), SECSH-ARCH(20),
|
||||
SECSH-FILEXFER(06)*, SECSH-DHGEX(04), and SECSH-NUMBERS(10)
|
||||
|
||||
http://www.libssh2.org/
|
||||
|
||||
if BR2_PACKAGE_LIBSSH2
|
||||
|
||||
choice
|
||||
prompt "Crypto Backend"
|
||||
help
|
||||
Select crypto library to be used in libssh2.
|
||||
|
||||
config BR2_PACKAGE_LIBSSH2_MBEDTLS
|
||||
bool "mbedtls"
|
||||
depends on BR2_PACKAGE_MBEDTLS
|
||||
|
||||
config BR2_PACKAGE_LIBSSH2_LIBGCRYPT
|
||||
bool "gcrypt"
|
||||
depends on BR2_PACKAGE_LIBGCRYPT
|
||||
|
||||
config BR2_PACKAGE_LIBSSH2_OPENSSL
|
||||
bool "openssl"
|
||||
depends on BR2_PACKAGE_OPENSSL
|
||||
select BR2_PACKAGE_LIBOPENSSL_ENABLE_RMD160 if BR2_PACKAGE_LIBOPENSSL
|
||||
|
||||
endchoice
|
||||
endif
|
||||
3
package/libssh2/libssh2.hash
Normal file
3
package/libssh2/libssh2.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 9954cb54c4f548198a7cbebad248bdc87dd64bd26185708a294b2b50771e3769 libssh2-1.11.1.tar.xz
|
||||
sha256 f7f9633cf9ff2f1333f3d7ce46973a8716a4d2a2815ad56f30d437d5fea7bafe COPYING
|
||||
77
package/libssh2/libssh2.mk
Normal file
77
package/libssh2/libssh2.mk
Normal file
@@ -0,0 +1,77 @@
|
||||
################################################################################
|
||||
#
|
||||
# libssh2
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIBSSH2_VERSION = 1.11.1
|
||||
LIBSSH2_SOURCE= libssh2-$(LIBSSH2_VERSION).tar.xz
|
||||
LIBSSH2_SITE = https://www.libssh2.org/download
|
||||
LIBSSH2_LICENSE = BSD
|
||||
LIBSSH2_LICENSE_FILES = COPYING
|
||||
LIBSSH2_CPE_ID_VENDOR = libssh2
|
||||
LIBSSH2_INSTALL_STAGING = YES
|
||||
LIBSSH2_CONF_OPTS = --disable-examples-build --disable-rpath
|
||||
|
||||
# 0001-username-len-bound-checking.patch
|
||||
LIBSSH2_IGNORE_CVES += CVE-2026-7598
|
||||
|
||||
# 0002-packet-check-libssh2-get-string-return-in-EXT-INFO-handler.patch
|
||||
LIBSSH2_IGNORE_CVES += CVE-2026-55199
|
||||
|
||||
# 0003-transport-c-Additional-boundary-checks-for-packet-length.patch
|
||||
LIBSSH2_IGNORE_CVES += CVE-2026-55200
|
||||
|
||||
# 0004-sftp-symlink-fix-out-of-bounds-read.patch
|
||||
# 0005-libssh2-priv-backport-LIBSSH2_UNCONST.patch
|
||||
# 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
|
||||
|
||||
# 0008-openssl-fix-AES-GCM-bounds-checks.patch
|
||||
LIBSSH2_IGNORE_CVES += CVE-2026-66033
|
||||
|
||||
# 0009-publickey-fix-potential-OOB-read.patch
|
||||
LIBSSH2_IGNORE_CVES += CVE-2026-66034
|
||||
|
||||
# 0010-transport-fix-potential-heap-overflow-on-ETM-decrypt.patch
|
||||
LIBSSH2_IGNORE_CVES += CVE-2026-66035
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSSH2_MBEDTLS),y)
|
||||
LIBSSH2_DEPENDENCIES += mbedtls
|
||||
LIBSSH2_CONF_OPTS += --with-libmbedcrypto-prefix=$(STAGING_DIR)/usr \
|
||||
--with-crypto=mbedtls
|
||||
else ifeq ($(BR2_PACKAGE_LIBSSH2_LIBGCRYPT),y)
|
||||
LIBSSH2_DEPENDENCIES += libgcrypt
|
||||
LIBSSH2_CONF_OPTS += --with-libgcrypt-prefix=$(STAGING_DIR)/usr \
|
||||
--with-crypto=libgcrypt
|
||||
# configure.ac forgets to link to dependent libraries of gcrypt breaking static
|
||||
# linking
|
||||
LIBSSH2_CONF_ENV += LIBS="`$(STAGING_DIR)/usr/bin/libgcrypt-config --libs`"
|
||||
else ifeq ($(BR2_PACKAGE_LIBSSH2_OPENSSL),y)
|
||||
LIBSSH2_DEPENDENCIES += host-pkgconf openssl
|
||||
LIBSSH2_CONF_OPTS += --with-libssl-prefix=$(STAGING_DIR)/usr \
|
||||
--with-crypto=openssl
|
||||
# configure.ac forgets to link to dependent libraries of openssl breaking static
|
||||
# linking
|
||||
LIBSSH2_CONF_ENV += LIBS=`$(PKG_CONFIG_HOST_BINARY) --libs openssl`
|
||||
endif
|
||||
|
||||
# Add zlib support if enabled
|
||||
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
||||
LIBSSH2_DEPENDENCIES += zlib
|
||||
LIBSSH2_CONF_OPTS += --with-libz \
|
||||
--with-libz-prefix=$(STAGING_DIR)/usr
|
||||
else
|
||||
LIBSSH2_CONF_OPTS += --without-libz
|
||||
endif
|
||||
|
||||
HOST_LIBSSH2_DEPENDENCIES += host-openssl
|
||||
HOST_LIBSSH2_CONF_OPTS += --with-openssl \
|
||||
--with-libssl-prefix=$(HOST_DIR) \
|
||||
--without-libgcrypt
|
||||
|
||||
$(eval $(autotools-package))
|
||||
$(eval $(host-autotools-package))
|
||||
Reference in New Issue
Block a user