[12915] in bugtraq

home help back first fref pref prev next nref lref last post

Re: FTP DoS - PORT and PASV effected.

daemon@ATHENA.MIT.EDU (Henrik Nordstrom)
Fri Dec 10 11:39:56 1999

Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id:  <38504004.C20EBA6@hem.passagen.se>
Date:         Fri, 10 Dec 1999 00:49:24 +0100
Reply-To: hno@HEM.PASSAGEN.SE
From: Henrik Nordstrom <hno@HEM.PASSAGEN.SE>
X-To:         Darren Reed <avalon@COOMBS.ANU.EDU.AU>
To: BUGTRAQ@SECURITYFOCUS.COM

Darren Reed wrote:

> btw, a similar sort of attack can be mounted using the PORT command.
> You just need to setup a local listener, etc, or get the ftp server
> to try connect to lots of network 10 sites in < 75 seconds before
> TCP connect's start timing out.  I'll leave that as an exercise for
> the reader - a correct fix for the PASV problem should fix this one
> as well (and the exploit is almost the same too).

I think the some development version of wu-ftpd is safe from the PORT
version of the attack. PORT (or default) data connection can only be
used once per transfer, and the some development versions of wu-ftpd
requires the client to close the data connection before it acknowledging
the transfer, thereby limiting the PORT version of the attack to once
per control connection. Most versions (i.e. the versions currently
commonly used) does not do this and can be exploited using PORT.

Thinking of it the PASV based attack can be stopped by similar (generic)
measures. Simply do NOT accept the establishment of a new data
connection unless the client has closed the previous connection. This
could be done in at least two ways without any noticeable impact on RFC
compliance:

a) When closing any existing data connection due to port specification
change, make sure the client also closes it's end of the connection
before continuing processing.

b) Do not accept the establishment of a new data connection until the
client has fully closed down any previous connection.

Of the two, alternative b is the one least likely to cause
interoperability problems with clients behaving badly. Both methods are
fully generic and not tied to any connection establishement method.

The FTP server should also clearly log (and close) any open data channel
on exit, to alert the administrator that there may be a problem.

Simply closing the control connection if a second PASV command is seen
is in my eyes not a good approach. While it may stop this particular DOS
it is very specific and can probably be fooled in one way or another. It
is also in violation of the spirit of RFC 959.

--
Henrik Nordstrom

home help back first fref pref prev next nref lref last post