dhewm3
dhewm3 copied to clipboard
Filesystem calls allow r/w outside game directory
For example, try dir "../../../", or WriteConfig "../../../../boot/grub/grub.cfg" (If anybody is stupid enough to run dhewm as root). I think this should be fixed. (Look at darkplaces's FS_CheckNastyPath for example)
It might be a good idea to prevent dhewm3 from being run under root or setuid to 0 at all. We did the same in YQ2 a long time ago: https://github.com/yquake2/yquake2/blob/master/src/backends/unix/main.c#L114
I merged a change to prevent the game from being run as root.
I'll keep this issue open because eventually I want to look at the filesystem code and find out if preventing access out of the allowed directories is feasible