mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-12 03:00:26 +09:00
CVE-2026-0965 config: Do not attempt to read non-regular and too large configuration files
Changes also the reading of known_hosts to use the new helper function Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdbool.h>
|
||||
#endif /* _WIN32 */
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -137,6 +138,8 @@ int ssh_check_username_syntax(const char *username);
|
||||
void ssh_proxyjumps_free(struct ssh_list *proxy_jump_list);
|
||||
bool ssh_libssh_proxy_jumps(void);
|
||||
|
||||
FILE *ssh_strict_fopen(const char *filename, size_t max_file_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -508,6 +508,9 @@ char *ssh_strerror(int err_num, char *buf, size_t buflen);
|
||||
#define SSH_TTY_MODES_MAX_BUFSIZE (55 * 5 + 1)
|
||||
int encode_current_tty_opts(unsigned char *buf, size_t buflen);
|
||||
|
||||
/** The default maximum file size for a configuration file */
|
||||
#define SSH_MAX_CONFIG_FILE_SIZE 16 * 1024 * 1024
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user