mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:03:31 +03:00
ftp,imap,pop3: do not ignore --ssl-reqd
In imap and pop3, check if TLS is required even when capabilities request has failed. In ftp, ignore preauthentication (230 status of server greeting) if TLS is required. Bug: https://curl.se/docs/CVE-2021-22946.html CVE-2021-22946
This commit is contained in:
parent
43157490a5
commit
364f174724
7 changed files with 195 additions and 36 deletions
|
|
@ -2681,9 +2681,12 @@ static CURLcode ftp_statemachine(struct Curl_easy *data,
|
|||
/* we have now received a full FTP server response */
|
||||
switch(ftpc->state) {
|
||||
case FTP_WAIT220:
|
||||
if(ftpcode == 230)
|
||||
/* 230 User logged in - already! */
|
||||
return ftp_state_user_resp(data, ftpcode, ftpc->state);
|
||||
if(ftpcode == 230) {
|
||||
/* 230 User logged in - already! Take as 220 if TLS required. */
|
||||
if(data->set.use_ssl <= CURLUSESSL_TRY ||
|
||||
conn->bits.ftp_use_control_ssl)
|
||||
return ftp_state_user_resp(data, ftpcode, ftpc->state);
|
||||
}
|
||||
else if(ftpcode != 220) {
|
||||
failf(data, "Got a %03d ftp-server response when 220 was expected",
|
||||
ftpcode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue