|
Bugzilla – Full Text Bug Listing |
| Summary: | VUL-0: CVE-2005-0372: directory traversal bug in gftp | ||
|---|---|---|---|
| Product: | [Novell Products] SUSE Security Incidents | Reporter: | Ludwig Nussel <lnussel> |
| Component: | Incidents | Assignee: | Security Team bot <security-team> |
| Status: | RESOLVED FIXED | QA Contact: | Security Team bot <security-team> |
| Severity: | Normal | ||
| Priority: | P3 - Medium | CC: | sbrabec, security-team |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | CVE-2005-0372: CVSS v2 Base Score: 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N) | ||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
sample malicious ftp server
gftp-directory-traversal.patch gftp-path.patch gftp-path-backport.patch |
||
|
Description
Ludwig Nussel
2005-01-04 00:13:20 UTC
Created attachment 27358 [details]
sample malicious ftp server
modified version of the reporter's ftp server. run e.g. ./ftpd-iexpl /etc/motd
/tmp/foo and connect on localhost:2121. Click on the left arrow to download the
file into your home and find yourself having /tmp/foo instead.
Working on patch. What's the plan to 'fix' it? Looks like other ftp clients either don't display such files at all or don't allow to do anything useful with it. Are you in contact with upstream? I wanted to save it as strrchr ("/", filename).
Another problem of gftp is, that file exist check for this file is negative,
even if destination file exists.
Not yet in contact with upstream. Should I contact author in private mail or is
author already informed? (Brian Masney <masneyb@gftp.org>).
Bug for IE is public: http://secunia.com/advisories/13704/ * This comment was added by mail. Yes, please contact the upstream author. I'll notify vendor-sec. The IE stuff is public, yes. It came via full-disclosure and gets quite some public attention (see www.heise.de). From Brian Masney <masneyb@gftp.org>: I was already notified about this. To fix this, I plan on running strrchr() on the filename in the *_get_next_file() functions. I will do this in lib/rfc959.c, lib/sshv2.c and lib/fsp.c (not in CVS yet). In lib/rfc2068.c, files that have a .. in them will generate a warning and they will be ignored. I am planning on releasing 2.0.18 by the 15th. I am leaving this evening for Alabama to go caving underground and I won't be back in town until Sunday night. Brian swampid: 103 any news? Author did not release promised update. I will look at code and try to write a fix. Created attachment 27732 [details]
gftp-directory-traversal.patch
Draft of the patch. The patch has one drawback - it cannot download file
containing '/' from server (with exception of proof of concept server), because
it sanitizes also GET string. Fixing this will require duplication of file item
to safe_file_name and server_file_name.
Another solution is skipping such files at all or mangling file names as
"ALERT...".
Yet another solution is revertable sanitizing using % notation for these
strings.
Created attachment 27767 [details] gftp-path.patch From Brian Masney <masneyb@gftp.org> To: Stanislav Brabec <sbrabec@suse.cz> Subject: Re: security: Directory traversal bug in gftp Hi, Here is the patch that I commited to CVS a little bit ago. I added the necessary checks to gftp_get_next_file(). gftp_parse_ls() is not used by all protocols, namely it isn't used by the SSH and FSP protocols. Let me know if you run into any problems with this patch. I also have my latest CVS code online at http://www.gftp.org/gftp-test.tar.bz2 (MD5SUM 5182d34745a43cf1e5b045e860485083) Brian Created attachment 27768 [details]
gftp-path-backport.patch
There is a problem: The fix works with proof of concept FTP server, but does
not work with servers with real files - it sends RETR /foo, not RETR
/../../../../../../../../../../../tmp/foo.
I don't know FTP standard. Is such file legal? If not, we can ignore it.
* This comment was added by mail. I don't know. I think it's pretty much not standardized. Other ftp clients don't show such a file at all so who cares as long as it doesn't overwrite files it shouldn't :-) Fix submitted for 8.1, 8.2, 9.0, 9.1, 9.2, SLES9-SLD, STABLE and PLUS. CAN-2005-0372 packages released CVE-2005-0372: CVSS v2 Base Score: 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N) |