Some ideas/possibilities:
- Restrict logfile creation to the same folder as gzdoom.exe.
- Add a prefix or suffix to the specified name, so as to avoid possibly overwriting any pre-existing files.
- Force a .log file extension.
Moderator: GZDoom Developers
I'd suggest that said prefix be in a similar format to screenshots, i.e. [logname]-[date]-[start time of log].txt.Kinsie wrote:[*]Add a prefix or suffix to the specified name, so as to avoid possibly overwriting any pre-existing files.
Though that brings to mind such use cases as running GZDoom off an external drive or on a system that does not necessarily have full write access (such as playing off a thumb drive on a public computer). Those would need to be accounted for, too, I would think.AFADoomer wrote:But if you're going to be thorough, the save command can take full paths as well, so is similarly problematic.
Code: Select all
# GZDoom Log FileWhat about saving log files in the same place as save games and the like? On Linux, this is ~/.config/gzdoom. Screenshots are placed in ~/.config/gzdoom/screenshots, so perhaps log files can go in ~/.config/gzdoom/logs (and the name given to the logfile command would be relative to this, an absolute path would be ignored).Rachael wrote:Ultimately the implementation of something like this has to be platform-specific. For obvious reasons you cannot restrict logfile naming on Linux platforms to the same folder as gzdoom - it has to go to /var/log/gzdoom or something like that, if the program is installed using root credentials.
I'm pretty sure that the main point of the 3.2.4 release was that the attack vector discusssed there was removed. This was done by adding a whitelist mechanism to the MENUDEF DoCommand implementation.ZippeyKeys12 wrote:Ummm...
I think that's why AFADoomer.
It's still an avenue for damage if some other exploit is found. It's also good to ensure functions are focused on doing what they were made to do, and if log files can be put into their own specific directory (like screenshots and savegames), it's good to ask if it's still worth the risk of letting the logfile command write everywhere the process is allowed to.AFADoomer wrote:I'm pretty sure that the main point of the 3.2.4 release was that the attack vector discusssed there was removed.
In software I write where this matters, I usually handle this by writing a path parser, which has some sort of "level" integer. Each directory increases it, while ".." decreases it and "." does nothing. You basically just deny paths that ever obtain a negative value.Chris wrote:It would also need to disallow '..' in the given path, which could break out of the log directory.