dhewm3 icon indicating copy to clipboard operation
dhewm3 copied to clipboard

Filesystem calls allow r/w outside game directory

Open tyabus opened this issue 3 years ago • 2 comments

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)

tyabus avatar Nov 16 '21 17:11 tyabus

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

Yamagi avatar Nov 16 '21 20:11 Yamagi

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

DanielGibson avatar Dec 16 '21 23:12 DanielGibson