Last revised: February 15, 2002
Source: CERT/CC
A complete revision history can be found at the end of this file.
Systems Affected
- Systems running WU-FTPD and its derivatives
Overview
WU-FTPD is a widely deployed software package used to provide File Transfer Protocol (FTP) services on UNIX and Linux systems. There are two vulnerabilities in WU-FTPD that expose a system to potential remote root compromise by anyone with access to the FTP service. These vulnerabilities have recently received increased scrutiny.
I. Description
There are two remote code execution vulnerabilities in the Washington University FTP daemon (WU-FTPD). Both of these vulnerabilities have been discussed in public forums and have received widespread exposure.
VU#886083: WU-FTPD does not properly handle file name globbing
WU-FTPD features globbing capabilities that allow a user to specify multiple file names and locations using typical shell notation. See CERT Advisory CA-2001-07 for a more complete explanation of globbing.
WU-FTPD implements its own globbing code instead of using libraries in the underlying operating system. When the globbing code is called, it allocates memory on the heap to store a list of file names that match the expanded glob expression. The globbing code is designed to recognize invalid syntax and return an error condition to the calling function. However, when it encounters a specific string, the globbing code fails to properly return the error condition. Therefore, the calling function proceeds as if the glob syntax were correct and later frees unallocated memory that can contain user-supplied data.
If intruders can place addresses and shellcode in the right locations on the heap using FTP commands, they may be able to cause WU-FTPD to execute arbitrary code by later issuing a command that is mishandled by the globbing code.This vulnerability is potentially exploitable by any user who is able to log in to a vulnerable server, including users with anonymous access. If the exploit is successful, an attacker may be able to execute arbitrary code with the privileges of WU-FTPD, typically root. If the exploit is unsuccessful, the thread servicing the request will fail, but the WU-FTPD process will continue to run.
Note that at least one derivative of WU-FTPD, BeroFTPD, is also vulnerable. BeroFTPD has been merged back into WU-FTPD and is no longer separately maintained.
This vulnerability has been assigned the identifier CAN-2001-0550 by the Common Vulnerabilities and Exposures (CVE) group:
CORE Security Technologies has published a Vulnerability Report on this issue:
VU#639760: WU-FTPD configured to use RFC 931 authentication running in debug mode contains format string vulnerability
WU-FTPD can perform RFC 931 authentication when accepting inbound connections from clients. RFC 931 defines the Authentication Server Protocol, and is obsoleted by RFC 1413 which defines the Identity Protocol. RFC 931 is commonly known as "auth" or "authd", and RFC 1413 is commonly known "ident" or "identd". Both are named after the daemon that commonly provides the service.
When using RFC 931 authentication, WU-FTPD will request ident information before authorizing a connection request from a client. The auth or ident service running on the client returns user-specific information, allowing WU-FTPD to make authentication decisions based on data in the ident response.
WU-FTPD can also be run in debugging mode, which provides detailed information about its operation.
When WU-FTPD is configured to perform RFC 931 authentication and is run in debug mode, it logs connection information using syslog(3) function calls. The logging code does not include format string specifiers in some syslog(3) calls, nor does the code perform adequate input validation on the contents of the identd response received from a client. As a result, a crafted identd response containing user-supplied format string specifiers is interpreted by syslog(3), possibly overwriting arbitrary locations in memory. By carefully designing such a request, an attacker may execute arbitrary code with the privileges of WU-FTPD.
This vulnerability is potentially exploitable by any user who is able to log in to a vulnerable server, including users with anonymous access. The intruder must also be able to control their response to the ident request. If successful, an attacker may be able to execute arbitrary code with the privileges of WU-FTPD, typically root.
Note that this vulnerability does not manifest unless WU-FTPD is configured to use RFC 931 authentication and is run in debug mode.
This vulnerability has been assigned the identifier CVE-2001-0187 by the Common Vulnerabilities and Exposures (CVE) group:
II. Impact
Both of these vulnerabilities can be exploited remotely by any user with access to the FTP service, including anonymous access. Both vulnerabilities allow an intruder to execute arbitrary code with the privileges of WU-FTPD, typically root. An exploit attempt that does not succeed in executing code may crash WU-FTPD or end the connection used by the intruder.
For additional information about the impacts of each of these vulnerabilities, please consult the CERT Vulnerability Notes Database (http://www.kb.cert.org/vuls).
III. Solution
Apply patches from your vendor
Appendix A contains information for this advisory provided by vendors. As they report new information to the CERT/CC, we will update this section and note the changes in our revision history. If a particular vendor is not listed below, we have not received their comments. Please contact your vendor directly.
Although some distributions may not include WU-FTPD, it can be compiled and run on a wide variety of UNIX and Linux systems. If you install WU-FTPD separately, apply the source code patches from the WU-FTPD Development Group.
Restrict access to WU-FTPD
As a general practice, the CERT/CC recommends disabling services and access that are not explicitly required. You may wish to disable WU-FTPD until you are able to apply a patch.
If you cannot disable the service, you can limit your exposure to these vulnerabilities by blocking or restricting access to the control channel (by default, port 21/tcp) used by WU-FTPD. In the case of the format string vulnerability (VU#639760), an exploit would be transmitted from port 113/tcp on the attacking host to the WU-FTPD server that made the identd request. Note that blocking access from untrusted networks such as the Internet does not protect your systems against attacks from within your network.
Disable anonymous FTP access
Although disabling anonymous FTP access does not prevent attacks from occurring, it does prevent unauthenticated users from attempting to exploit the globbing vulnerability (VU#886083).
Appendix A. Vendor Information
This appendix contains information provided by vendors for this advisory. As vendors report new information to the CERT/CC, we will update this section and note the changes in our revision history. If a particular vendor is not listed below, we have not received their comments. Note that this advisory discusses two distinct vulnerabilities, and vendor statements may address one or both.
BeroFTPD
Parts of WU-FTPD's globbing code are shared by BeroFTPD, which is vulnerable to the glob handling problem described in VU#886083. BeroFTPD has been merged back into WU-FTPD and is no longer separately maintained.Caldera
Caldera has addressed VU#886083 with the following Caldera Security Advisories:- Caldera Security Advisory CSSA-2001-041.0 (Linux)
http://www.caldera.com/support/security/advisories/
CSSA-2001-041.0.txt - Caldera Security Advisory CSSA-2001-SCO.36 (UnixWare)
ftp://stage.caldera.com/pub/security/unixware/CSSA-2001-SCO.36.2/
CSSA-2001-SCO.36.2.txt - Caldera Security Advisory CSSA-2001-SCO.36 (Open UNIX)
ftp://stage.caldera.com/pub/security/unixware/CSSA-2001-SCO.36.2/
CSSA-2001-SCO.36.2.txt - Caldera Security Advisory CSSA-2002-SCO.1 (OpenServer)
ftp://stage.caldera.com/pub/security/openserver/CSSA-2002-SCO.1/
CSSA-2002-SCO.1.txt
Compaq Computer Corporation
This reported problem [VU#886083] could not be exploited on Compaq Tru64/UNIX Operating Systems Software. WU-FTPD 2.6.1 is shipped on the Internet Express CD.Conectiva
Conectiva has released the following Conectiva Linux Security Announcements:- VU#886083: Conectiva Linux Security Announcement CLA-2001:442
http://distro.conectiva.com.br/atualizacoes/?id=a&anuncio=000442 - VU#639760: Conectiva Linux Security Announcement CLA-2001:443
http://distro.conectiva.com.br/atualizacoes/?id=a&anuncio=000443
Cray
Cray, Inc. is not vulnerable since the ftp supplied with UNICOS and UNICOS/mk is not based on the Washington University version. Cray did check their ftp code and does not see this exploit.Debian
Debian has released the following Debian Security Advisories:- VU#886083: Debian Security Advisory DSA-087
http://www.debian.org/security/2001/dsa-087 - VU#639760: Debian Security Advisory DSA-016 (January 2001)
http://www.debian.org/security/2001/dsa-016
Fujitsu
Regarding VU#886083 and VU#639760 (WU-FTPD vulnerabilities), UXP/V is not vulnerable, because UXP/V does not support WU-FTPD.Hewlett-Packard Company
HP's HP-UX is immune to this issue [VU#886083]. It was fixed in conjunction with the last "globbing" issue announced in CERT Advisory CA-2001-07, released April 10, 2001. The lab did a complete check/scan of the globbing software, and fixed this issue then as well. Customers should apply the patches listed in HP Security Bulletin #162 released July 19, 2001:- HPSBUX0107-162 Security Vulnerability in ftpd and ftp
- HPSBUX0201-180 Sec. Vulnerability with WU-FTPD 2.6
IBM Corporation
IBM's AIX operating system does not use WU-FTPD, hence is not vulnerable to the exploit described by CORE ST.Immunix
Immunix has released the following Immunix OS Security Advisories:- VU#886083: Immunix OS Security Advisory IMNX-2001-70-036-01
http://download.immunix.org/ImmunixOS/7.0/updates/
IMNX-2001-70-036-01 - VU#639760: Immunix OS Security Advisory IMNX-2001-70-036-02
http://download.immunix.org/ImmunixOS/7.0/updates/
IMNX-2001-70-036-02
MandrakeSoft
MandrakeSoft has addressed VU#886083 with Mandrake Linux Security Update Advisory MDKSA-2001:090:NcFTP Software
All versions of NcFTPd Server are not vulnerable to the problems described by VU#886083 and VU#639760.OpenBSD
OpenBSD does not use WU-FTPD.Red Hat
Red Hat has addressed VU#886083 with Red Hat Linux Errata Advisory RHSA-2001-157:SGI
SGI does not ship IRIX with WU-FTPD, so IRIX is not vulnerable to these issues.Sun
Sun [Solaris] does not ship WU-FTPD, thus Solaris is not affected by these issues.
[Concerning VU#886083], the only Sun Cobalt Server Appliance that is vulnerable to this exploit is the Qube1. The Qube1 is no longer a supported appliance, but we do understand the need of having updates available. The following RPM is not officially supported by Sun Cobalt, but offers legacy customers the ability to maintain a limited level of security.
Qube1:
SuSE
SuSE has addressed VU#886083 with SuSE Security Announcement SuSE-SA:2001:043.Turbolinux
Turbolinux has addressed VU#886083 with Turbolinux Advisory TLSA2002002.WU-FTPD
The WU-FTPD Development Group has provided source code patches that address both of these issues in WU-FTPD 2.6.1:- VU#886083:
ftp://ftp.wu-ftpd.org/pub/wu-ftpd-attic/wu-ftpd-2.6.1-patches/
ftpglob.patch - VU#639760:
ftp://ftp.wu-ftpd.org/pub/wu-ftpd-attic/wu-ftpd-2.6.1-patches/
missing_format_strings.patch
The CERT Coordination Center thanks CORE Security Technologies and the WU-FTPD Development Group for their help
Author: Art Manion
References
- http://www.kb.cert.org/vuls/id/886083
- http://www.kb.cert.org/vuls/id/639760
- http://www.kb.cert.org/vuls
- http://www.ietf.org/rfc/rfc931.txt
- http://www.ietf.org/rfc/rfc1413.txt
- http://www.ietf.org/rfc/rfc959.txt
- http://www.corest.com/pressroom/advisories_desplegado.php?
idxsection=10&idx=172
Copyright 2002 Carnegie Mellon University.
Revision History
November 29, 2001: initial release November 30, 2001: updated vendor information, CAN/CVE number, WU-FTPD 2.6.2, "Apply paches" December 4, 2001: updated vendor information, WU-FTPD patch locations, wrap long URLs December 10, 2001: included BeroFTPD information, updated title of VU#886083 December 17, 2001: updated BeroFTPD information January 10, 2002: updated Caldera information January 23, 2002: updated HP information February 4, 2002: added Turbolinux and Compaq information February 15, 2002: updated Caldera information