Securing tmp impossible, security hazzard?
Posted: Mon Feb 14, 2005 8:35 pm
Hi there,
In the last stage of securing the Unreal installation I noticed something weird.. Its my habbit to make sure that the irc useraccount has only write access to partitions which were mounted 'noexec' in order to make sure that if a service gets compromised the amount of damage can be minimized (think about local root exploits and such).
To my surprise Unreal refused to start up after I replaced the tmp directory with a symlink. When trying to start Unreal it gave me this error:
* Loading IRCd configuration ..
* unrealircd.conf:7: loadmodule modules/commands.so: failed to load: tmp/AEDDC39
8.commands.so: failed to map segment from shared object: Operation not permitted
[error] IRCd configuration failed to load
At first I thought to be dealing with a problem in handleing symlinks (the file was created) but it soon turned out that Unreal is trying to execute code from the tmp directory. As soon as the tmp symlink points to a directory on a 'noexec' partition Unreal refuses to start. I find this quite extraordinair since it can pose a serious security threat if you need to allow it to write data which it needs to be able to execute as well.
My obvious question is simple: is there any way to avoid this kind of behaviour ?
In the last stage of securing the Unreal installation I noticed something weird.. Its my habbit to make sure that the irc useraccount has only write access to partitions which were mounted 'noexec' in order to make sure that if a service gets compromised the amount of damage can be minimized (think about local root exploits and such).
To my surprise Unreal refused to start up after I replaced the tmp directory with a symlink. When trying to start Unreal it gave me this error:
* Loading IRCd configuration ..
* unrealircd.conf:7: loadmodule modules/commands.so: failed to load: tmp/AEDDC39
8.commands.so: failed to map segment from shared object: Operation not permitted
[error] IRCd configuration failed to load
At first I thought to be dealing with a problem in handleing symlinks (the file was created) but it soon turned out that Unreal is trying to execute code from the tmp directory. As soon as the tmp symlink points to a directory on a 'noexec' partition Unreal refuses to start. I find this quite extraordinair since it can pose a serious security threat if you need to allow it to write data which it needs to be able to execute as well.
My obvious question is simple: is there any way to avoid this kind of behaviour ?