trusted-vs-untrusted

sandbox to execute possibly unfriendly python code [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-11-28 20:53:30
This question already has an answer here: How can I sandbox Python in pure Python? 8 answers Python, safe, sandbox [duplicate] 9 answers Let's say there is a server on the internet that one can send a piece of code to for evaluation. At some point server takes all code that has been submitted, and starts running and evaluating it. However, at some point it will definitely bump into "os.system('rm -rf *')" sent by some evil programmer. Apart from "rm -rf" you could expect people try using the server to send spam or dos someone, or fool around with "while True: pass" kind of things. Is there a

sandbox to execute possibly unfriendly python code [duplicate]

非 Y 不嫁゛ 提交于 2019-11-27 13:17:14
问题 This question already has an answer here: How can I sandbox Python in pure Python? 8 answers Python, safe, sandbox [duplicate] 9 answers Let's say there is a server on the internet that one can send a piece of code to for evaluation. At some point server takes all code that has been submitted, and starts running and evaluating it. However, at some point it will definitely bump into "os.system('rm -rf *')" sent by some evil programmer. Apart from "rm -rf" you could expect people try using the