- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Root-owned file vulnerable under user dir
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 10:36 PM
тАО04-19-2004 10:36 PM
A file owned by root is resident under a user directory.
The user (owner of the parent directory) can delete the root file, even though he obviously is not the owner and does not have super-user privileges.
The root-owned file also has persmissions set of "chmod 100": execute for root only, no other permissions, no SUID bits, nothing.
I can reproduce this at will.
Are we saying then that if you own a directory, you can delete the contents at will, regardless of ownership?
This isn't how I've understood UNIX security over the last 10 years.
This server is running 11.11 with Dec 2002 GPK, no extras.
What am I missing?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 10:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 10:42 PM
тАО04-19-2004 10:42 PM
Re: Root-owned file vulnerable under user dir
It is normal. And this is how it works on my system as well except the following difference in my case:
$rm sss
sss: 644 mode ? (y/n) y
FILE gone.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 10:54 PM
тАО04-19-2004 10:54 PM
Re: Root-owned file vulnerable under user dir
this is normal behavior. Deleting a file means writing in its directory.
As Mark says you should set the sticky bit on the directory (chmod u+t).
According to the man page, the owner of the file, the owner of the directory or superuser can remove the file (even if the modes of the directory would otherwise allow such operation).
To be honest I learned about the sticky directory bit on a Linux course...
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 10:58 PM
тАО04-19-2004 10:58 PM
Re: Root-owned file vulnerable under user dir
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2004 01:23 AM
тАО04-20-2004 01:23 AM
Re: Root-owned file vulnerable under user dir
chmod u+t .....
and the guy can STILL delete a file touched by root.
WHAT NOW?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2004 01:38 AM
тАО04-20-2004 01:38 AM
Re: Root-owned file vulnerable under user dir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2004 02:03 AM
тАО04-20-2004 02:03 AM
Re: Root-owned file vulnerable under user dir
The actual definition is that when the sticky bit is set in a directory, only the owner of the file AND the owner of the directory can remove the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2004 02:08 AM
тАО04-20-2004 02:08 AM
Re: Root-owned file vulnerable under user dir
the owner of the directory can remove root's file in that dir. Check the manpage of chmod on sticky bit.
According to the man page, the owner of the file, the owner of the directory or superuser can remove the file (even if the modes of the directory would otherwise allow such operation).
Jeroen P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2004 02:13 AM
тАО04-20-2004 02:13 AM
Re: Root-owned file vulnerable under user dir
maybe I should add the word ONLY:
ONLY the owner of the file, the owner of the directory or superuser can remove the file (even if the modes of the directory would otherwise allow such operation).
So if the directory is group-writable, members of the group cannot delete root's file if the directory has sticky bit.
Regardless of the file's protection, the directory owner can remove the file (if the directory has sticky bit or if the owner has write access to his/her own directory).
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2004 02:26 AM
тАО04-20-2004 02:26 AM
Re: Root-owned file vulnerable under user dir
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2004 02:34 AM
тАО04-20-2004 02:34 AM
Re: Root-owned file vulnerable under user dir
Just a reiteration on what Bill has already mentioned.
-Hazem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2004 04:09 AM
тАО04-21-2004 04:09 AM
Re: Root-owned file vulnerable under user dir
You make it sound like a bad thing that the owner can remove a root owned file from his "domain".
As a application owner, or a owner of a directory. you better believe, I want to be able to remove "ANY" file in "MY" directories. futher more, I don't want root to be able to put anything in "MY" space.
Permissions are also designed to protect the user. In my mind, the only exception should be "lost+found" on file systems owned by a user or application. Then as an administrator (root), I encourge the user to leave it alone.
Now, If I am a "rogue" user, Then lets talk restricted shell, and files that I may use.
Good Luck
Rory