1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
syed abdul khaliq 87a0fb354f userauth: free list packet on oversize methods in userauth_list() error path
userauth_list() keeps the server's USERAUTH_FAILURE/BANNER response in
session->userauth_list_data. Five of its error returns free that buffer
before returning NULL (the data_len < 5 check, the three banner checks,
and the SUCCESS case), but the oversize-methods check does not. When a
server sends a methods length field that is >= the bytes actually
present, the function returns at the LIBSSH2_ERROR_OUT_OF_BOUNDARY
branch with the response packet still allocated, so it leaks (the
pointer is only reclaimed at session teardown, or overwritten and leaked
again if the caller retries).

The patch adds the SSH2_SAFEFREE already used by the adjacent data_len <
5 branch, so the last error path frees what the function owns. Trigger
is a server response whose methods length field exceeds the packet body.

Closes #2667
2026-10-16 18:18:43 +02:00
2026-09-13 16:12:32 +02:00
2026-04-10 18:39:11 +02:00
2026-09-14 11:22:52 +02:00
2023-06-07 08:18:55 +02:00
2011-04-04 13:31:33 +02:00
2026-10-07 16:12:21 +02:00

libssh2 - SSH2 library

libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license.

Web site

Mailing list

BSD Licensed

Web site source code

Installation instructions:

Description
libssh2 - это библиотека, реализующая протокол SSH2, доступная по пересмотренной лицензии BSD
Readme 26 MiB
Languages
C 84.2%
CMake 3.7%
Perl 3.2%
M4 2.7%
Shell 2.3%
Other 3.7%