From owner-freebsd-bugs Fri Jun 7 9:40:31 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B407637B413 for ; Fri, 7 Jun 2002 09:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g57Ge1k42872; Fri, 7 Jun 2002 09:40:01 -0700 (PDT) (envelope-from gnats) Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117]) by hub.freebsd.org (Postfix) with ESMTP id 54B0737B407 for ; Fri, 7 Jun 2002 09:30:38 -0700 (PDT) Received: from www.freebsd.org (localhost [127.0.0.1]) by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g57GUYhG031795 for ; Fri, 7 Jun 2002 09:30:34 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.2/8.12.2/Submit) id g57GUYVE031794; Fri, 7 Jun 2002 09:30:34 -0700 (PDT) Message-Id: <200206071630.g57GUYVE031794@www.freebsd.org> Date: Fri, 7 Jun 2002 09:30:34 -0700 (PDT) From: Peter da Silva To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/38987: FTP anonymous user can create directories Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 38987 >Category: misc >Synopsis: FTP anonymous user can create directories >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jun 07 09:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Peter da Silva >Release: FreeBSD 4.4-Release >Organization: ABB Network Management >Environment: FreeBSD foyer.abbnm.com 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Thu Apr 25 03:46:49 CDT 2002 root@foyer.abbnm.com:/usr/src/sys/compile/FOYER i386 >Description: anonymous user can make directories under incoming and use ftp server as dropbox for warez. >How-To-Repeat: ftp localhost Username: ftp Password: me@here ftp> cd pub/incoming ftp> mkdir dropbox >Fix: This should probably be made a command line option. I know "this web form should not be used to submit code as plain text", but the patch is straightforward: *** ftpd.c.orig Fri Jun 7 06:40:00 2002 --- ftpd.c Fri Jun 7 06:40:25 2002 *************** *** 2187,2193 **** { LOGCMD("mkdir", name); ! if (mkdir(name, 0777) < 0) perror_reply(550, name); else reply(257, "MKD command successful."); --- 2187,2195 ---- { LOGCMD("mkdir", name); ! if (guest) ! reply(550, "%s: permission denied", name); ! else if (mkdir(name, 0777) < 0) perror_reply(550, name); else reply(257, "MKD command successful."); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message