Date: Sat, 10 Apr 2010 03:56:09 -0300 From: Norbert Zeh <nzeh@cs.dal.ca> To: freebsd-bugs@freebsd.org Subject: Re: jail users can delete files they shouldn't Message-ID: <20100410065609.GL22422@cs.dal.ca> In-Reply-To: <4BC00CC7.4080907@fuujingroup.com> References: <4BC00CC7.4080907@fuujingroup.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Erich Jenkins, Fuujin Group Ltd [2010.04.09 2329 -0600]: > I've gone through the archives for the Jail list, and I'm not finding > anything specific to the issue we're experiencing. My apologies if this > is a known issue or if I've done something daft, but there appears to be > a file permission issue with jails. > > We have a large deployment of jailed systems, and an issue was brought > to my attention today that I hope very much is the result of a > misconfiguration or other mistake. > > Background: > > Environment is FreeBSD 7.0-REL and 8.0-REL > Platforms include i386 (x86 Xeon), amd64 (Opteron) and sparc64 (Netra X1's) > Jail environment is a Complete jail, not an application jail > > Situation: > > A user managed to kill an apache process today, resulting in their > virtual web server (in a jail) going down. The user does not have root > privileges on this box, and is not a member of wheel. Upon inspection, I > found that the user had deleted a config file that was owned by root > (chmod 700). It appears they were not able to read the file, but they > were able to delete it which I confirmed with the user. > > Test: > > To verify what appeared to be happening, I created a file in the users > home directory (typed some garbage into a text file) owned by root (700) > and in the wheel group. I then logged into the users account via ssh as > that user. I attempted to su to root, which I could not (as expected). I > tried to read the file and could not (as expected). Then I tried to > delete the file. Bingo. File was gone. It's not the file permissions that control whether you can delete it but the user's permission on the directory containing the file. If the user has write access to the directory, they can delete whatever is contained in that directory. Since you talk about the user's home directory, I assume they have write access. N.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100410065609.GL22422>