Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jul 2002 19:04:35 +0400
From:      Yar Tikhiy <yar@comp.chem.msu.su>
To:        Ruslan Ermilov <ru@FreeBSD.ORG>
Cc:        net@FreeBSD.ORG
Subject:   Re: ftpd(8) DoS: SIZE in ASCII mode
Message-ID:  <20020729190435.C33729@comp.chem.msu.su>
In-Reply-To: <20020726202255.GA9263@sunbay.com>; from ru@FreeBSD.ORG on Fri, Jul 26, 2002 at 11:22:55PM %2B0300
References:  <20020726155745.B2089@comp.chem.msu.su> <20020726202255.GA9263@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 26, 2002 at 11:22:55PM +0300, Ruslan Ermilov wrote:
> On Fri, Jul 26, 2002 at 03:57:45PM +0400, Yar Tikhiy wrote:
> > 
> > I've been pointed out by Maxim Konovalov recently that our stock
> > ftpd(8) allowed an easy DoS attack against a server running it by
> > issuing numerous "SIZE" commands on huge files when in ASCII mode.
> > In this case, ftpd(8) has to read a whole file instead of just
> > issuing a single stat(2) syscall, thus eating up the server's
> > disk bandwidth.
> > 
> > The obvious solution is to disable the "SIZE" command when in ASCII
> > mode.  So I'd like to ask the community whether anyone thinks there
> > must be an option to enable it back.  Personally, I feel the command
> > must be disabled completely (for ASCII mode, of course) since I see
> > no good use for it at all.
> > 
> How about going the lukemftpd(8) way?
> 
> 	if (stbuf.st_size > 10240) {
> 		reply(550, "%s: file too large for SIZE.", filename);
> 		(void) fclose(fin);
> 		return;
> 	}

It looks like a nice approach at the first glance.  I still doubt
type A SIZE necessity at all, but let it be this way if noone objects.

-- 
Yar

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020729190435.C33729>