-
Notifications
You must be signed in to change notification settings - Fork 64
Saving can overwrite arbitrary files #46
Comments
I hope you're not running DumbFrotz as a user that has write privileges anywhere sensitive. Good idea though. I'll see what I can cook up this weekend. An easier thing to implement would be to specify that we should always save the game with a given filename. The managing program could then monitor that file for changes and then move or delete it as needed. What do you think? |
Sounds good, I can check whether any new save files appear after each command is issued and upload before deleting. I ought to suggest something similar for restoring, but I should do that in another issue. |
There are two other potential problems: script files and command recordings. How about this: A flag takes a directory path as a parameter. If this flag is used, then all files created will go there with no additional paths allowed, that is, cut off everything to left of a slash including the slash itself. This should keep users from traipsing about the filesystem. |
I am unsure of what script files or command recordings are. Forcing a directory as a flag should also work, although it would need me to create a folder for every game that is started (since multiple games can run concurrently), but I should still be able to detect, upload and delete anything in each folder. |
The Z-machine provides mechanisms for creating a transcript of the game and for recording the commands used. The commands |
I see. This should work then, the save-detector can ignore |
Or clear them out when the user is finished playing. Suppose the user reaches an undesirable ending and wants to load a save file. |
The game would end when the user chooses to I have plans for a rudimentary filestorage system that allows uploading/downloading scr/rec/saves that last between the time the game starts and ends. (or just only upload saves because of how complicated that might get) |
I see. Thanks for bringing up this problem. |
Please take a look at 5432358 and tell me if it meets your requirements. |
Restricted read/write now in both curses and dumb interfaces: a14dc90 Invoke it with the Modification for DOS interface pending. |
I can't read C, but with the description, that should suffice. |
Oops! I just realized that my restriction code doesn't actually restrict reading. |
I run a Discord Bot that runs games on instances of DumbFrotz. However, when saving a game, one can specify an arbitrary filepath for the save, potentially overwriting other files in the entire filesystem.
Examples of dangerous filepaths one can specify:
/home/pi/Desktop/save
../save
Replacing
save
with any filename will simply overwrite them.Suggestions:
A flag when initializing DFrotz to output the raw savedata to STDOUT to be read externally by the program managing it.
The text was updated successfully, but these errors were encountered: