Artifacts Associated With Ticket 930225ffffffffffffffffffffffffffffffffff
Ticket change [c8a2079af6] (rid 122139) by dgp on 2004-04-06 05:13:52:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
While reading man pages on the access() system call, I came across: CAVEAT Access() is a potential security hole and should never be used. Yet, the access() call is the implementation of Tcl_FSAccess() on native Unix filesystems in tcl/unix/tclUnixFile.c - foundin initialized to: "obsolete: 8.4.6"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "37. File System"
- title initialized to: "access() - safe to use?"
- type initialized to: "Bug"
Ticket change [339a27b884] (rid 106626) by vincentdarley on 2004-04-06 14:26:10:
- assignee changed to: "hobbs"
- icomment:
Logged In: YES user_id=32170 I know nothing about such unix-specific technicalities (and don't really want to learn ;-)... assigning to someone who does.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Ticket change [e43fca3828] (rid 87921) by dkf on 2004-04-06 16:36:42:
- icomment:
Logged In: YES user_id=79902 Which OS states this in its manpages? The security problems of access() only really bite when running setuid/setgid, since you otherwise go through the same set of checks internally when you manipulate the file with open(), etc. Luckily, that's not a normal configuration of Tcl so we can ignore it for now. The alternatives are to stat() and check the permissions on the file ourselves (which has exactly the same security problems) or open the file and either check the result or do an fstat(), which has its own set of problems (especially when writing a file.) Everything gets *much* more complex when you use AFS or some other filesystem with ACLs, and it turns out that the access(2) manpage on RH9 is wrong (as access() checks ACLs) and is therefore not replacable with any *stat() based solution. I think the only "fix" is to warn people writing scripts that run setuid/setgid to be very careful. And beware of scaremongering manual pages.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [13c78716c4] (rid 124277) by dgp on 2004-04-06 20:40:21:
- icomment:
Logged In: YES user_id=80530 I was on a Mac OS X Panther system when I read that. I think the man page originally came from some BSD.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [708c29db03] (rid 100498) by dkf on 2004-04-06 21:38:30:
- icomment:
Logged In: YES user_id=79902 OK, access(2) is broken-by-design but we can't substitute for anything else. Solution is for *users* to avoid it when running in a Tcl interpreter with non-trivial privileges. In theory we could enforce this by refusing to call access() when the real and effective [ug]ids are different, but that would be very intrusive. A better solution would be to provide access to something like fstat() so that code could check that it has opened what it thinks it has opened...?
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [7e532d07c5] (rid 97392) by dgp on 2004-04-07 03:29:06:
- assignee changed to: "dgp"
- closedate changed to: "2004-04-06T20:29:06"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Fair enough. For the record, besides Tcl_FSAccess() and Tcl_Access() itself, this will impact the built-in commands [file executable|writable|readable|link], [cd], [load] on all platforms, and [exec] and [open "|..."] on Windows.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Closed"
- username: "dgp"
Ticket change [bfedb3f66f] (rid 102329) by dgp on 2004-04-07 03:59:31:
- icomment:
Logged In: YES user_id=80530 Ignore the part of my last comment about Windows. access() is not used there.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [da5161678c] (rid 107753) by dkf on 2004-04-07 04:37:47:
- icomment:
Logged In: YES user_id=79902 Neither [cd] nor [load] are affected on native filesystems. OTOH, [file executable] etc are, but that's because they're just a wrapper round access()'s basic functionality. In general, if you can it is better to just [open] (with the right options; with the wrong ones you still have a security hole) or [exec] the file and check for errors in the process.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment: