You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Get the path to the default configuration dir to use, if NULL// is passed to M_SetConfigDir.staticchar*GetDefaultConfigDir(void)
{
char*result= (char*)malloc(2);
result[0] ='.';
result[1] ='\0';
returnresult;
}
The M_GetSaveGameDir function attempts to create a directory by concatenating configdir and "savegame/", resulting in a hidden directory called .savegame which probably wasn't intended. The intended path was probably meant to be ./savegame/.
//// Calculate the path to the directory to use to store save games.// Creates the directory as necessary.//char*M_GetSaveGameDir(char*iwadname)
{
char*savegamedir;
#ifORIGCODEchar*topdir;
#endif
# ...
savegamedir=M_StringJoin(configdir, "savegame/", NULL);
M_MakeDirectory(savegamedir);
printf ("Using %s for savegames\n", savegamedir);
Creation of directories in the current working directory creates the possibility for symlink attacks.
Should root desire to slay some demons while browsing a directory writable by low privileged users, such as /tmp, and should a low privileged user have preemptively created the following directory structure, then /etc/passwd would be overwritten by root's saved game.
By default, SerenityDOOM uses the current working directory
.
to store and load configuration files and save game files.config.c :
The
M_GetSaveGameDir
function attempts to create a directory by concatenatingconfigdir
and"savegame/"
, resulting in a hidden directory called.savegame
which probably wasn't intended. The intended path was probably meant to be./savegame/
.Creation of directories in the current working directory creates the possibility for symlink attacks.
Should
root
desire to slay some demons while browsing a directory writable by low privileged users, such as/tmp
, and should a low privileged user have preemptively created the following directory structure, then/etc/passwd
would be overwritten by root's saved game.The text was updated successfully, but these errors were encountered: