VOGONS


First post, by tbtom

User metadata
Rank Newbie
Rank
Newbie

I'm using DOSBox (on macOS, but I believe the issue is not specific to one operating system), and it seems that in DOSBox I can mount arbitrary paths from my file system and access them – including for destructive operations.

A typical usage example might look something like:

mount C /my/favourite/dos/game
C:
play

, which is all good and nice assuming that play doesn't run harmful/malicious code, but is there anything preventing it from doing things like

mount D /very/important/files
D:
del *.*

?

I wrote a similar PLAY.BAT and ran it without problems, observing that it indeed deleted files outside the directory manually mount-ed by the user.

I tried to find a config setting to restrict the paths that can be mounted or to specify mounts to be made upon loading DOSBox and disable mount-ing from within DOSBox itself, but couldn't find any. Is there such a setting, and/or any other remedy to this severe vulnerability?

Reply 1 of 3, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Secure mode
https://www.dosbox.com/DOSBoxManual.html

It's no more or less secure than any other program, but the above option will do what you want. Deletes aren't as big of a deal as untracked modifications or exfiltration.

How To Ask Questions The Smart Way
Make your games work offline

Reply 2 of 3, by Cuttoon

User metadata
Rank Oldbie
Rank
Oldbie

I'd say "secure mode" is the best you get - just mount the needed path in the dosbox config file and "play" won't be able to mount things on its own.

If you want to protect even the files that need to be mounted, from accidental or malicious access, make temporary copies for use during the session only - but I assume that's not the issue.

I like jumpers.

Reply 3 of 3, by tbtom

User metadata
Rank Newbie
Rank
Newbie

Thanks – "secure mode" is exactly what I was looking for!