mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesse Pollard <pollard@tomcat.admin.navo.hpc.mil>
To: dax@gurulabs.com, Jesse Pollard <pollard@tomcat.admin.navo.hpc.mil>
Cc: linux-kernel@vger.kernel.org,
	"michael@hostsharing.net" <michael@hostsharing.net>
Subject: Re: suid bit on directories
Date: Tue, 21 May 2002 08:34:07 -0500 (CDT)	[thread overview]
Message-ID: <200205211334.IAA21448@tomcat.admin.navo.hpc.mil> (raw)

Dax Kelson <dax@gurulabs.com>
> On Mon, 20 May 2002, Jesse Pollard wrote:
> 
> > > > No. You loose the fact that the file was NOT created by the user.
> > > 
> > > the user in my example above would be wwwrun or httpd - and that does not
> > > make any sense at all! It would make much more sense if the new files
> > > belonged to the owner of the directory, who is the one who owns the
> > > virtual host.
> > 
> > You can't tell who the user is. ANY user would be able to do that.
> 
> Bzzzt.  Only if the permissions permitted it.
> 
> 
> Example 1:
> 
> /home/bob/public_html
> 
> public_html  is user/group  bob/httpd
> 
> the perms are 2770
> 
> ============================
> 
> Example 2:
> 
> All users on the system have a primary or secondary group "users"
> 
> /home/bob   user/group  bob/users
> 
> perms are 701
> 
> This explictly denies "users", yet allows Apache in (since it is running 
> as httpd).


And if "bob" makes the file world readable it can't be read by someone else?
And if the file is supposed to be updated by the web server it can't be
created (truncated, unless also world writeable)? If not, then his implies that
besides changing the owner of created files, the changed owner is also
used to verify authorization to create.

Granted, this limits the identity of the attacker to anyone in the group
httpd or the user.

And the world x doesn't grant access? (have you seen the attempts to get
a "open file by inode" added? very usefull for file migration - and almost
mandatatory for performance reasons. And also usefull for attacks.
Fortunately, it isn't there yet, and hopefully it will be restricted).

The attacker may not be able to read the directory, but he can certanly
attack it by just creating/opening files in the home directory. That could gain 
access to OTHER files in the home directory.

You also have problems with backup/restore done by users. Tar/cpio will/can
change the group ownership of the directory, and will change group ownership
of any files/subdirectories restored. Even cp would cause problems
by preventing the web server from access (again, it must be created world
readable). Also exposes potential damage in crash situations (though not
as bad as external attack - lost files become world accessable).

ACLs would be much easer to support. Try them out..

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

             reply	other threads:[~2002-05-21 13:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-21 13:34 Jesse Pollard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-05-21 13:34 Jesse Pollard
2002-05-18  8:34 Michael Hoennig
2002-05-18  8:52 ` Cedric Ware
2002-05-18 10:34   ` Michael Hoennig
2002-05-19  1:12     ` jw schultz
2002-05-20 13:04 ` Jesse Pollard
2002-05-20 13:24   ` Michael Hoennig
2002-05-20 14:03     ` Jesse Pollard
2002-05-20 14:53       ` Michael Hoennig
2002-05-20 18:12         ` dean gaudet
2002-05-21 17:48           ` Bill Davidsen
2002-05-20 19:28         ` Jesse Pollard
2002-05-20 20:58           ` Miquel van Smoorenburg
2002-05-20 21:15           ` Michael Hoennig
2002-05-21 18:03             ` Bill Davidsen
2002-05-22  4:44               ` Michael Hoennig
2002-05-21  3:49           ` Dax Kelson
2002-05-20 15:53       ` Bill Davidsen
2002-05-20 19:17       ` Albert D. Cahalan
2002-05-20 20:17         ` Jesse Pollard
2002-05-21  3:28       ` Dax Kelson
2002-05-21  3:58         ` Dax Kelson
2002-05-21 18:04           ` Bill Davidsen
2002-05-21 18:35             ` J Sloan
2002-05-20 15:42   ` Bill Davidsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200205211334.IAA21448@tomcat.admin.navo.hpc.mil \
    --to=pollard@tomcat.admin.navo.hpc.mil \
    --cc=dax@gurulabs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@hostsharing.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®