Hey Unix geeks,
Let's say I have a folder like this:
/users/fred/catproject/cache
Inside the cache folder, which is completely world-readable, writagle and executable, there will be world-writable, world-readable, world-executable files. Worse, those files are .php files. This is Very Bad because there are other users on the system who could therefore overwrite those files with PHP code of their own and wreak havoc.
The good news is that the "fred" folder is
not world-readable, writable and executable. Neither is "catproject." So bad guys have to guess the "catproject" part of the full path before they can cause trouble. Unfortunately, "catproject" is supposed to be a friendly project name, so it is not very hard to guess.
However, what if the project lived here:
/users/fred/23098420398423094/catproject/c
ache
Where that big number is a randomly generated value with a cryptographically reasonable number of digits so that it's statistically impossible to guess it?
Then the system seems to be safe... there's no way for an outsider to ever figure out the name of the vulnerable cache folder... provided of course that no error message or readable log file ever, ever, ever leaks out the path information.
Am I missing anything here or is this true as far as it goes?
Obviously it is better to use virtual machines, chroot jails, dedicated servers, etc. But for sticker-shock reasons it is not always realistic to present those options to a client. At the same time I can't give them a trivially insecure system.
Thanks.
Tags: geek, unix