4 ms·
How are you ensuring that the input is safe? I just tried `import sys;sys.exit(0)` and got an error message thankfully :)
by omouse 19y ago
How are you ensuring that the input is safe? I just tried `import sys;sys.exit(0)` and got an error message thankfully :)
- tocomment 19y agoGood question. I run the code first through a parser that (hopefully) removes all unsafe elements like file, and import. It was a Python cookbook recipe I found. If the site gets more popular, I'd like to switch to running an unrestricted interpreter in a chroot jail so users will have access to the full power of Python and third party libraries like PIL.