=========================================================== == Subject: Potential NULL dereference in libssh's sftp == server == == CVE ID#: CVE-2023-3603 == == Versions: master only == == Summary: Processing SFTP server read may cause NULL == dereference == =========================================================== =========== Description =========== Missing allocation check in sftp server processing read requests may cause NULL dereference on low-memory conditions. The malicious client can request up to 4GB SFTP reads, causing allocation of up to 4GB buffers, which is being unchecked for failure. This will likely crash the authenticated user sftp server's connection (if implemented as forking as we recommend). For thread-based servers, this might cause DoS also for legitimate users. ================== Patch Availability ================== Patches addressing the issues have been posted to: https://www.libssh.org/security/ Given this code is not in any released versions, no security release have been issued. ================== CVSSv3 calculation ================== CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L (3.1) ========== Workaround ========== The SFTP server implementation is based on callbacks so you can rewrite the sftp_channel_default_data_callback() [1] to provide additonal checks. [1] https://gitlab.com/libssh/libssh-mirror/-/blob/master/examples/sample_sftpserver.c#L330 ======= Credits ======= Originally reported by Wei Chong Tan. Patches provided by Jakub Jelen of the libssh team. ========================================================== == The libssh team ==========================================================