There have been various posts complaining about the Lua sandbox, and how it interferes with attempts by genuine scriptwriters to provide a good experience for their players.
I'll start by repeating what I said in another thread recently:
We hear daily reports about security problems with Windows, and how accounts are stolen or compromised, due to ineffective security.
It seems bizarre to me to be arguing for the removal of the sandbox, which effectively gives anyone who convinces a player to load a plugin complete control over their PC.
Sure, we may get less complaints about having to do a few extra steps to get a plugin to work, but how about the extra complaints that their entire character was hacked and all their gear stolen?
I can see there are a couple of issues however. One is that some other languages (like VBscript) are not sandboxed and thus in themselves represent a security threat.
Another is that, if you are going to trust MUSHclient, you may as well trust at least some plugin writers, like ones who post here frequently, and have a good reputation.
So rather than arguing that since the back door lock is broken, we may as well leave the front door unlocked as well, perhaps we can address the real issues.
The insecurity of VBscript and other WSH languages
This could be addressed by making the default to not allow those script languages at all (effectively sandboxing them out of existence). Then you would have to make a conscious decision to allow one. So for example, if you download a Python plugin, the player has to actively approve its use. There could be a message "warning - this script language gives uncontrolled access to your PC - do you want to allow this?".
The annoyance of installing plugins from trusted players
This could be addressed by some sort of trust system (like security certificates from web sites). I'm hazy on how the details would work, but some sort of certification process that a trusted writer (eg. Twisol, Worstje) could easily generate, but that an unknown writer could not. Then MUSHclient could have a list of trusted script-writers that are automatically allowed to have plugins installed, including bypassing the existing sandbox.
These trusted certificates could be:
I should mention in passing that I personally use the sandbox for other purposes than just security. For instance, if I put in it:
Then every world automatically has access to the tprint utility without it having to be loaded every time I want to check out a table.
I'll start by repeating what I said in another thread recently:
Nick Gammon said:
Many people will recall that Microsoft have come in for quite a bit of sledging because their operating systems are perceived as having security flaws. Unfortunately, good security and ease-of-use are quite often opposing design goals.
Earlier versions of Windows tried to make things easy for the end-user, but in the process arguably introduced potential security problems. More recently things have been tightened up, but you now have the counter problem that if people get used to hundreds of security warnings (and clicking on "OK - get on with it") then the usefulness of the warnings tends to go away too.
In the case of MUSHclient, I didn't want to get into the minefield of releasing software that could be easily used to compromise the end-user's PC, so in the case of Lua (over which I had some control), there were two levels of security introduced:
Many people will recall that Microsoft have come in for quite a bit of sledging because their operating systems are perceived as having security flaws. Unfortunately, good security and ease-of-use are quite often opposing design goals.
Earlier versions of Windows tried to make things easy for the end-user, but in the process arguably introduced potential security problems. More recently things have been tightened up, but you now have the counter problem that if people get used to hundreds of security warnings (and clicking on "OK - get on with it") then the usefulness of the warnings tends to go away too.
In the case of MUSHclient, I didn't want to get into the minefield of releasing software that could be easily used to compromise the end-user's PC, so in the case of Lua (over which I had some control), there were two levels of security introduced:
- The "sandbox" in its default configuration disabled various functions (such as os.remove) which could potentially cause a lot of havoc. This sandbox was designed so that individual plugins (and world files) could be "trusted" so that, if necessary, they could do things like open and write files.
- The second problem was loading DLLs. A DLL (dynamic link library) by its very nature can execute anything at all (like, scanning all your directories, finding interesting files, and uploading them to some server). Thus the checkbox "Allow DLLs to be loaded" was introduced, so that if unchecked, no DLLs could be loaded. However if checked, then you still have the fallback of needing to trust the plugin.
We hear daily reports about security problems with Windows, and how accounts are stolen or compromised, due to ineffective security.
It seems bizarre to me to be arguing for the removal of the sandbox, which effectively gives anyone who convinces a player to load a plugin complete control over their PC.
Sure, we may get less complaints about having to do a few extra steps to get a plugin to work, but how about the extra complaints that their entire character was hacked and all their gear stolen?
I can see there are a couple of issues however. One is that some other languages (like VBscript) are not sandboxed and thus in themselves represent a security threat.
Another is that, if you are going to trust MUSHclient, you may as well trust at least some plugin writers, like ones who post here frequently, and have a good reputation.
So rather than arguing that since the back door lock is broken, we may as well leave the front door unlocked as well, perhaps we can address the real issues.
The insecurity of VBscript and other WSH languages
This could be addressed by making the default to not allow those script languages at all (effectively sandboxing them out of existence). Then you would have to make a conscious decision to allow one. So for example, if you download a Python plugin, the player has to actively approve its use. There could be a message "warning - this script language gives uncontrolled access to your PC - do you want to allow this?".
The annoyance of installing plugins from trusted players
This could be addressed by some sort of trust system (like security certificates from web sites). I'm hazy on how the details would work, but some sort of certification process that a trusted writer (eg. Twisol, Worstje) could easily generate, but that an unknown writer could not. Then MUSHclient could have a list of trusted script-writers that are automatically allowed to have plugins installed, including bypassing the existing sandbox.
These trusted certificates could be:
- Pre-installed; or
- Installed once per author when required; or
- Checked by querying the mushclient.com web site in some way (say, once per certificate)
I should mention in passing that I personally use the sandbox for other purposes than just security. For instance, if I put in it:
require "tprint"
Then every world automatically has access to the tprint utility without it having to be loaded every time I want to check out a table.