Only allow safe protocols for cURL downloads

A malicious server could abuse dangerous protocols such as gopher:// to,
for instance, send mail via SMTP.
This commit is contained in:
Mickaël Thomas 2017-08-16 04:47:27 +02:00 committed by Zack Middleton
parent 9736e7ff91
commit bae86208f9

View file

@ -299,6 +299,8 @@ void CL_cURL_BeginDownload( const char *localName, const char *remoteURL )
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_PROTOCOLS,
CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | CURLPROTO_FTPS);
clc.downloadCURLM = qcurl_multi_init();
if(!clc.downloadCURLM) {
qcurl_easy_cleanup(clc.downloadCURL);