- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Setuid scripts
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
Forums
Discussions
Discussions
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
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
06-28-2003 09:22 AM
06-28-2003 09:22 AM
Setuid scripts
People says using setuid scripts are security hole.Can anyone explain how?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2003 09:43 AM
06-28-2003 09:43 AM
Re: Setuid scripts
It's like hiding the key to your front door under the welcome mat.
In general it's just a bad idea, but it's not criminal. You need to be "selective" as to what you do and don't set the uid on.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2003 10:32 AM
06-28-2003 10:32 AM
Re: Setuid scripts
Setuid scripts are always a security hole. Read the whole question at comp.unix.questions.
http://www.cs.uu.nl/wais/html/na-dir/unix-faq/faq/part4.html
HTH,
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2003 10:42 AM
06-28-2003 10:42 AM
Re: Setuid scripts
-r-sr-xr-x 31 root sys 544768 Jul 20 19:07 lvcreate
The above 'lvcreate' command is owned by 'root:sys' but the setuid bit '-r-s' is set.
Do you want commands like 'shutdown' to be world executable or have scripts that can be modified and rerun that have 'setuid' embedded within?
Say you've got a cron that goes off and its modified with the above command. The culprit who was once unable to shutdown the server because he didn't have root, now can.
Here's how you 'setuid' is set:
chmod 4--- /usr/sbin/shutdown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2003 10:42 AM
06-28-2003 10:42 AM
Re: Setuid scripts
If we set the setuid bit on a script that is owned by user_a. Then anyone who has execute permissions on the script would run it as user_a.
The problem is if users have "write" permission or they can append codes to the script.
Therefore don't allow them to write or put their own code into the script.
For such purpose of setuid, I prefer to start the process directly as the user. And I think we should stay away from using setuid scripts because it is just a bad habit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2003 03:26 PM
06-28-2003 03:26 PM
Re: Setuid scripts
Similarly, a script might copy some files as root but without filename checking, a hacker could specify a replacement password file and copy their own version on top of /etc/passwd. There are other hacks including setting an unsecure PATH variable (the script forgot to replace $PATH with a known list), setting IFS, and a bunch of other hacks that are widely known and documented.
Don't ever create a set UID script! Use sudo and put appropriate checks in place to prevent problems. Or write all set UID code as an executable problem in C or FORTRAN, etc. You still need security checks inside executable programs too.
Bill Hassell, sysadmin