CVE-2010-2252: Input Validation
+++ This bug was initially created as a clone of Bug #591580 +++
The draft advisory from oCERT follows:
The lftp, wget and lwp-download applications are ftp/http clients and file transfer tools supporting various network protocols. The lwp-download script is shipped along with the libwww-perl library.
Unsafe behaviours have been found in lftp and lwp-download handling the Content-Disposition header in conjunction with the 'suggested filename' functionality.
Additionally unsafe behaviours have been found in wget and lwp-download in case of HTTP 3xx redirections during file dowloading. The two applications automatically use the URL's filename portion specified in the Location header.
Implicitly trusting the suggested filenames results in a saved file that differs from the expected one according to the URL specified by the user. This can be used by a malicious attacker to silently write hidden and/or initialization files under the user's current directory (e.g. .login, .bashrc).
The impact of this vulnerability is increased in the case of lftp/lftpget as the default configuration allows file overwrite without prompting confirmation to the user. In case of lftp the get1 command is affected. This command can be invoked directly by the user from lftp's command line interface or indirectly by using the lftpget script, packaged within lftp distribution.
Affected version:
lftp <= 4.0.5 wget <= 1.12 libwww-perl <= 5.834
Fixed version:
lftp >= 4.0.6 wget N/A libwww-perl >= 5.835
Credit:
Vulnerability discovered and reported by Hank Leininger and Solar Designer under the Openwall Project, with further analysis by Daniele Bianco of oCERT.
--- Additional comment from vdanen on 2010-05-15 08:54:02 EDT ---
Florian noted the following as testcases for wget:
$ wget http://www.postbank.de/-snm-0184304830-1273865547-04f6f00001-0000000023-1273866968-enm-privatkunden/fondsboerse.htm (adds ;jsessionied= to the stored file name)
There's yet another case, but that only results in an index.html download.
$ wget http://www.enyo.de/fw
--- Additional comment from vdanen on 2010-05-17 10:51:26 EDT ---
This is now public:
http://www.ocert.org/advisories/ocert-2010-001.html
--- Additional comment from vdanen on 2010-05-18 11:17:25 EDT ---
Florian made a post to oss-security with a preliminary patch for wget. It probably requires some upstream review as it does add a new configuration option:
http://article.gmane.org/gmane.comp.security.oss.general/2908
However, Ludwig Nussel indicates that wget's behaviour is acceptable and probably doesn't require fixing at all, as wget does not overwrite existing files by default (adds suffixes like .1 and .2 to the new file if it already exists), and also prints the file name it used so there are no surprises.
In light of that, I would consider this a non-issue for wget, especially considering how intrusive the patch is for a backport.
Other sources
GNU Wget 1.12 and earlier uses a server-provided filename instead of the original URL to determine the destination filename of a download, which allows remote servers to create or overwrite arbitrary files via a 3xx redirect to a URL with a .wgetrc filename followed by a 3xx redirect to a URL with a crafted filename, and possibly execute arbitrary code as a consequence of writing to a dotfile in a home directory.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2010-2252?
CVE-2010-2252 is classified as a moderate severity vulnerability.
How do I fix CVE-2010-2252?
To fix CVE-2010-2252, you should upgrade to Wget version 1.12 or later.
Which versions of Wget are affected by CVE-2010-2252?
CVE-2010-2252 affects multiple versions of Wget, including 1.5.3 through 1.11.4.
What type of vulnerability is CVE-2010-2252?
CVE-2010-2252 is a vulnerability that allows for multiple HTTP client download filename manipulation.
Is there a patch available for CVE-2010-2252?
Yes, a patch is available in the form of newer versions of Wget, specifically 1.12 and above.