1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2026-10-24 03:48:55 +03:00
Commit Graph

6704 Commits

Author SHA1 Message Date
Jakub Jelen
07430deb9b libssh-0.12.2
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
libssh-0.12.2
2026-07-28 13:43:10 +02:00
Pavol Žáčik
64680cff32 gssapi: export ssh_userauth_gssapi_keyex
Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/866>
(cherry picked from commit 6b4826c257)
2026-07-28 13:40:56 +02:00
Pavol Žáčik
f13ecf9d74 knownhosts: Return SSH_KNOWN_HOSTS_UNKNOWN with GSS KEX and no host key
Also document that the knownhosts check may alternatively be skipped
with GSS key exchange, since the server is already authenticated
via Kerberos MIC.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/842>
(cherry picked from commit d9a31b0932)
2026-07-28 13:40:56 +02:00
Pavol Žáčik
e9f81a5e99 Add a new API function ssh_session_kex_is_gss
Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/842>
(cherry picked from commit 55fb99fcba)
2026-07-28 13:40:56 +02:00
Pavol Žáčik
c11551f290 mlkem_crypto: Fix fallback to default provider in FIPS
Using the FIPS OpenSSL provider, EVP_PKEY_CTX_new_from_pkey
does not return NULL with an ML-KEM key even if the
FIPS provider does not support ML-KEM and the propquery is NULL.
In both ssh_mlkem_encapsulate and ssh_mlkem_decapsulate, we would
therefore initialize the context with the FIPS provider
instead of the fallback (default) provider and the functions
would later fail during EVP_PKEY_encapsulate_init or
EVP_PKEY_decapsulate_init, respectively.

With this change, we determine the correct propquery to use
in FIPS mode by checking whether we can fetch the ML-KEM
implementation from the FIPS provider. The propquery is cached.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/862>
(cherry picked from commit a7ab540c55)
2026-07-28 13:40:56 +02:00
Martin Pitt
006ddd5035 CVE-2026-59843 tests: Verify zero max packet size in channel open is rejected
Cover both directions with unit tests: a client receiving
SSH2_MSG_CHANNEL_OPEN_CONFIRMATION with a maximum packet size of 0 must
not transition the channel to the open state, and a server receiving
SSH2_MSG_CHANNEL_OPEN with a maximum packet size of 0 must reject the
request. Both come with a positive control using a valid packet size.

Signed-off-by: Martin Pitt <mpitt@debian.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/863>
(cherry picked from commit 7d7c3a04a2)

Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
2026-07-28 13:40:56 +02:00
Pavol Žáčik
3f78590576 channels: Fail when receiving max packet size 0
Do this both for SSH2_MSG_CHANNEL_OPEN and for
SSH2_MSG_CHANNEL_OPEN_CONFIRMATION. Using the
max packet size 0 would lead to an infinite loop
in channel_write_common.

Originally reported by Rinku Das on on 23th February.
Independently reported by Yi Lin on 26th February and
Haruto Kimura on 22nd March.

We do not consider this as a security issue as connecting
to untrusted servers on the internet brings much worse
security consequences than hanging your clinet.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 44b186fa17)
2026-07-28 13:40:56 +02:00
Shreyas Mahajan
3e0d16c89b tests: cover config-vs-app-set option precedence
Signed-off-by: Shreyas Mahajan <shreyasmahajan05@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/844>
(cherry picked from 1de573cfb5)
2026-07-23 17:36:54 +02:00
Shreyas Mahajan
f5beac436d options: do not let config override explicitly-set options
Signed-off-by: Shreyas Mahajan <shreyasmahajan05@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/844>
(cherry picked from commit af9977f855)
2026-07-23 17:35:33 +02:00
Pavol Žáčik
77da3e02af libssh 0.12.1
Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
libssh-0.12.1
2026-07-16 11:51:04 +02:00
Jakub Jelen
770eafb74b CVE-2026-15370 tests: verify the SFTP longname is in expected format
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit 31fe9efb21)
2026-07-16 11:51:04 +02:00
Jakub Jelen
4f0c400929 CVE-2026-15370 sftpserver: Avoid stack buffer overrun while processing long filenames
Backported from commit b2065f71c9
and commit 347c69d278.

Reported by Tristan.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
2026-07-16 11:51:04 +02:00
Pavol Žáčik
f2f1078d6d CVE-2026-59851 tests: add gssapi authentication tests with user mismatching the principal
Without any special configuration (e.g., in ~/.k5login), we should not
expect the principal alice@REALM to be able to authenticate as bob
against either sshd or a libssh server.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 098b427c87)
2026-07-16 11:51:04 +02:00
Pavol Žáčik
05d0fe43b5 CVE-2026-59851 test_server: add a better gssapi auth callback
The callback should check whether the principal
is authorized to log in as the user; krb5_kuserok
does exactly that.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 114b0dfc23)
2026-07-16 11:51:04 +02:00
Pavol Žáčik
73225a1774 CVE-2026-59851 gssapi-keyex: add a missing server callback dispatch
Like gssapi-with-mic, gssapi-keyex also requires
the server to decide whether the client that's
obtained a valid ticket for a specific principal
is authorized to log in under the requested user,
otherwise any client with a valid ticket would
be able to log in as an arbitrary local user.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit a45d20b752)
2026-07-16 11:51:04 +02:00
Jakub Jelen
7edddfc580 CVE-2026-59850 tests: Verify sending data after close does not trigger callbacks
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit 8784a20c59)
2026-07-16 11:51:04 +02:00
Jakub Jelen
7dfabb1fd2 CVE-2026-59850 channels: Avoid processing DATA packets on closed channels
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit a8a3fa352b)
2026-07-16 11:51:04 +02:00
Jakub Jelen
a540e27659 CVE-2026-59849 tests: Reproducer for infinite loops with non-default configurations
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit ba96c3c213)
2026-07-16 11:51:04 +02:00
Jakub Jelen
2a40a20b49 CVE-2026-59849 auth: Fix state machine to aovid infinite loop
After going through the whole list of certificates, the iterator was
set to NULL and at the beginning of the next loop reset to the start
of the list again, which caused infinite loop.

Adding one more intermediate state solves the issue.

Found by AISLE in partnership with Red Hat

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit bcfa191283)
2026-07-16 11:51:04 +02:00
Jakub Jelen
d9fef838e2 CVE-2026-59849 auth: Move certificate iterator on failure to prevent infinite loop
The loop will be infinite only when the server will not drop the connection
after infinite amount of pubkey auth requests.

Found by AISLE in partnership with Red Hat

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit bb96432364)
2026-07-16 11:51:04 +02:00
Pavol Žáčik
e3dc89de97 CVE-2026-59848 sftp: Initialize sftp_request_queue ptr in sftp_free
Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 00876f7658)
2026-07-16 11:51:04 +02:00
Pavol Žáčik
9563afc950 CVE-2026-59848 sftp: handle responses with unknown request IDs
This adds a new field to sftp_session_struct,
containing a list of outstanding request IDs.
An ID is added to the list when a request
is constructed and removed when the corresponding
request is received. If a client receives a response
with an unknown request ID, it reports an error.

Storing responses with unknown request IDs in
the response queue could be abused by a malicious
SFTP server which could deplete client memory
this way.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 26147eb476)
2026-07-16 11:51:04 +02:00
Jakub Jelen
d4847509b7 CVE-2026-59847 libcrypto: Fix symmetric issue during encryption
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit a5173c6ad2)
2026-07-16 11:51:04 +02:00
Jakub Jelen
c483a18735 CVE-2026-59847 libcrypto: Fix tag verification of AES-GCM ciphers
EVP_DecryptFinal() returns 0 errors, which was wrongly checked since
its introduction.

Reported by Ben Smyth discuss@bensmyth.com

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit 6d6cb6cb4d)
2026-07-16 11:51:04 +02:00
Jakub Jelen
2e74267b03 CVE-2026-59846 Block shell metacharacters from usernames
When an attacker could sneak the dollar sign or backslash into the username
expanded for example in proxy command, it can result in printing environment
variables that might contain secrets.

This is a fixup of CVE-2023-6004 which fixed this for hostnames, but these
two metacharacters were left out from the username filter.

This keeps the list in one place to simplify maintenance.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit 6309df220e)
2026-07-16 11:51:04 +02:00
Jakub Jelen
53b8152623 CVE-2026-59845 socket: Properly check fork() return code
During execution of proxy command, when fork() fails, its return value
is stored in pid and when the parent process attempts to kill it,
it sends the kill signal to all processes the calling application has
access to (except for init).

This caused nard to debug issues when the system under the load was hitting
fork failures, which resulted in killing of all the system processes
(of given user).

Reported and first patch iteration provided by: Halil Oktay (oblivionsage).

This code missing fork return value check is in libssh since 2010
(f31a14b793), but this issue is exploitable only
since libssh 0.9.0 as previously there was no implementation of killing
ProxyCommand children.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit 92b6fb9c5e)
2026-07-16 11:51:04 +02:00
Pavol Žáčik
2544f22733 CVE-2026-59844 sftpserver: cap accepted values of len in SSH_FXP_READ
The client-provided length is directly used in
a malloc in process_read(), so not restricting it
leads to allocations bounded only by UINT32_MAX.

The new cap is the same as the one currently used
by OpenSSH.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 6dba2e06f0)
2026-07-16 11:51:04 +02:00
Pavol Žáčik
5568ae6c5a CVE-2026-59842 kex-gss: Add missing length checks of peer Curve25519 keys
Receiving a short Curve25519 public key would cause an
out-of-bounds read, potentially leaking small amounts
of heap data if an attacker sends a prefix of
a valid public key and the key exchange succeeds.

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit ed9109dfc6)
2026-07-16 11:51:04 +02:00
Jakub Jelen
529c30c34a ci: Remove explicit macos image requirement
The gitlab removed macos 14 which resulted in failures. Instead of updating
and manually tracking specific macos version, we can leave the tag out to
keep up using the latest version.

https://docs.gitlab.com/ci/runners/hosted_runners/macos/#supported-macos-images

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/852>
(cherry picked from commit 60a4cd2b1a)
2026-07-13 17:34:36 +02:00
Jakub Jelen
348bff0323 Prevent memory leaks with repeated subsystem requests or channel requests
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit 7817e356a9)
2026-07-10 10:03:05 +02:00
Jakub Jelen
ce49129afd sftp: Harmonize return values from sftp server callbacks
Terminate also the SFTP server when the fatal error comes from the message
handlers.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit 1726018198)
2026-07-10 10:03:05 +02:00
Jakub Jelen
162fafbe34 tests: Verify repeated SFTP INIT messages are not allowed and negotiation works correctly
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit 4a6634739c)
2026-07-09 18:03:02 +02:00
Jakub Jelen
086f1ec88c sftp: Avoid handling repeated INIT messages
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit 9c11f84b3c)
2026-07-09 18:01:41 +02:00
Jakub Jelen
bfe25c6dde sftpserver: Send right version based on the client one
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit 6d2b270701)
2026-07-09 18:00:32 +02:00
Jakub Jelen
f347062fd9 tests: Verify we get expected SFTP version on server and client
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit ac1f059f70)
2026-07-09 17:58:12 +02:00
Jakub Jelen
63672a491e sftpserver: Avoid double converting version number
Fixes: #369

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit 35d1f96d8d)
2026-07-09 17:57:59 +02:00
Jakub Jelen
b9b43a0171 ci: Allow mbedtls 4.x build to fail temporarily
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/849>
(cherry picked from commit 576300419c)
2026-07-09 17:57:41 +02:00
Jiami Lin
4eb486dc09 packet: avoid logging uninitialized sequence number
ssh_packet_unimplemented() tries to unpack the uint32 sequence number from SSH_MSG_UNIMPLEMENTED. If the packet payload is malformed and does not contain the full sequence number, ssh_buffer_unpack() fails, but the function still logs seq. Return after the failed unpack so the uninitialized local variable is not formatted into the log message.

Signed-off-by: Jiami Lin <jiami3us@icloud.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/834>
(cherry picked from commit 9075952491)
2026-07-09 17:54:34 +02:00
David Cermak
0417a744b5 string: Made ssh_string_new() to zero-init payload on creation
Additional hardening realated to 3ce8bf3289 fix that
switches ssh_string_new() to calloc() so the payload bytes
are zero-initialised. ssh_string is used throughout libssh as a
byte container for wire data and crypto material; the uninitialised
payload is never semantically meaningful, and zeroing it kills the
"forgot to check read_len" class of bugs at the source.

Signed-off-by: David Cermak <d_cermak@centrum.cz>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/829>
(cherry picked from commit d94a96bf23)
2026-07-09 17:53:58 +02:00
Jakub Jelen
bcd8b9460b Fix semantics of strchr() for C23
In c23, strchr finally returns const char for const char pointers, which broke
CI after updating to Fedora 44 (gcc 16). The same issue surfaced on tumbleweed.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/830>
(cherry picked from commit bc3c8181e1)
2026-07-09 17:53:45 +02:00
Jakub Jelen
407d4f8141 tests: Implement code coverage for ssh_userauth_kbdint_getprompt()
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/827>
(cherry picked from commit 23b406f48e)
2026-07-09 17:52:52 +02:00
Jakub Jelen
04330f3ea2 auth: Avoid off-by-one overflow during kbdint authentication
Based on incomplete !754

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/827>
(cherry picked from commit 45cd13469c)
2026-07-09 17:50:48 +02:00
Colin Baumgarten
3d59361dc2 torture_packet: Improve checking of ssh_packet_socket_callback() return value
ssh_packet_socket_callback() will not return error codes like
SSH_ERROR on failure. Instead it will always return an unsigned
size_t value representing the number of bytes which have been
processed.

So adjust the assert in the test accordingly, making sure that all
input bytes have actually been processed.

Signed-off-by: Colin Baumgarten <colin.baumgarten@hubersuhner.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/824>
(cherry picked from commit a33da974ef)
2026-07-09 17:50:41 +02:00
Colin Baumgarten
61eea4c72b packet: Avoid redundant recursive calls in the socket data callback
After processing a packet and before returning the processed size,
ssh_packet_socket_callback() recursively calls itself if there are
still unprocessed bytes remaining in the socket buffer.

This is redundant because this function is already called in a loop
by its only caller until the socket buffer is drained or only a
partial packet remains.

The recursive call was introduced with c92f54102e at a time
where ssh_packet_socket_callback() was not yet called in a loop.
The loop was only introduced later by 186116f34a.

So remove the redundant recursive call, but leave a log message in
place to allow following packet processing from the logs.

Signed-off-by: Colin Baumgarten <colin.baumgarten@hubersuhner.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/824>
(cherry picked from commit 655601d357)
2026-07-09 17:50:31 +02:00
Colin Baumgarten
7c5da6dfd9 packet: Fix socket data callback return value on rekey failure
Both callers of ssh_packet_socket_callback() assume that it will
always return the number of bytes processed. They don't properly
handle negative return values like SSH_ERROR, even though the
function's doc-comment mentions them.

Handling negative values would not be straightforward because
the return type is unsigned (size_t).

So instead of fixing the callers, adjust the only place where a
negative value is returned right now (rekey failure) and align
it with the handling of all other possible errors in the same
function.

Signed-off-by: Colin Baumgarten <colin.baumgarten@hubersuhner.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/824>
(cherry picked from commit 1bd5c2b043)
2026-07-09 17:50:25 +02:00
Jakub Jelen
a128a3da8f dh-gex: Add missing goto error
Originally reported by Saransh Rana.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/825>
(cherry picked from commit 322b456790)
2026-07-09 17:50:19 +02:00
Pavol Žáčik
e3ec71152c gssapi: fail if the selected OID is not in client-supplied OIDs
This should not happen because the OID is selected
from a subset of client-supplied OID in gss_acquire_cred,
i.e., it would imply a bug in krb5. But better be safe,
it would later cause an out-of-bounds read in
ssh_gssapi_send_response.

Reported and patch provided by Meta (vulns@meta.com).

Signed-off-by: Pavol Žáčik <pzacik@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 81a7e92c44)
2026-07-09 17:50:06 +02:00
Nuhiat-Arefin
ffd06b1cd0 fix: initialize known_hosts output entry
ssh_session_get_known_hosts_entry() could return SSH_KNOWN_HOSTS_OK without initializing *pentry, leaving callers with an undefined output pointer.

Initialize *pentry to NULL at function entry so every return path leaves the output in a defined state.

Signed-off-by: Nuhiat-Arefin <nuhiatarefin@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/814>
(cherry picked from commit 6cd0e6e52a)
2026-07-09 17:49:35 +02:00
Jakub Jelen
49df3fa0dc channels: Avoid remote window overflow
Reported-by: Rinku Das <rinkudaskajal7857@gmail.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit d0f5747ab7)
2026-07-09 17:48:46 +02:00
Jakub Jelen
69fb4bd006 sftpserver: Check return value of sftp_client_message_get_filename()
Originally reported by nevv.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
(cherry picked from commit 5eb9e6896e)
2026-07-09 17:48:39 +02:00