|
Bugzilla – Full Text Bug Listing |
| Summary: | VUL-0: CVE-2023-3603: libssh: Processing SFTP server read may cause NULL dereference | ||
|---|---|---|---|
| Product: | [Novell Products] SUSE Security Incidents | Reporter: | Alexander Bergmann <abergmann> |
| Component: | Incidents | Assignee: | James McDonough <jmcdonough> |
| Status: | RESOLVED UPSTREAM | QA Contact: | Security Team bot <security-team> |
| Severity: | Normal | ||
| Priority: | P3 - Medium | CC: | anicka, cathy.hu, meissner, security-team, stoyan.manolov |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| URL: | https://smash.suse.de/issue/371772/ | ||
| Whiteboard: | CVSSv3.1:SUSE:CVE-2023-3603:3.1:(AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L) | ||
| Found By: | Security Response Team | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
Alexander Bergmann
2023-07-11 07:28:01 UTC
commit fe80f47b0ae8902d229ef9b8a1b4fa949b92e720 Author: Jakub Jelen <jjelen@redhat.com> Date: Tue Jun 27 14:56:14 2023 +0200 sftpserver: Add missing allocation check that might cause NULL dereference Originally reported by Wei Chong Tan <shellcurity at protonmail.com> Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Norbert Pocs <npocs@redhat.com> diff --git a/src/sftpserver.c b/src/sftpserver.c index 8f15f39e..7d8070b1 100644 --- a/src/sftpserver.c +++ b/src/sftpserver.c @@ -962,6 +962,12 @@ process_read(sftp_client_message client_msg) } buffer = malloc(client_msg->len); + if (buffer == NULL) { + ssh_set_error_oom(sftp->session); + sftp_reply_status(client_msg, SSH_FX_FAILURE, NULL); + SSH_LOG(SSH_LOG_PROTOCOL, "Failed to allocate memory for read data"); + return SSH_ERROR; + } do { ssize_t readn = read(fd, buffer + allreadn, client_msg->len - allreadn); if (readn < 0) { the problematic code is only in an unreleased libssh version, older versions are not affected. |