lupa

Can Lupa be used to run untrusted lua code in python?

此生再无相见时 提交于 2020-01-02 06:37:05
问题 Let's say I create LuaRuntime with register_eval=False and an attribute_filter that prevents access to anything except a few python functions. Is it safe to assume that lua code won't be able to do os.system("rm -rf *") or something like that? 回答1: From looking at the Lupa doc: Restricting Lua access to Python objects Lupa provides a simple mechanism to control access to Python objects. Each attribute access can be passed through a filter function as follows... It doesn't say anything about

Can Lupa be used to run untrusted lua code in python?

爷,独闯天下 提交于 2019-12-05 17:56:38
Let's say I create LuaRuntime with register_eval=False and an attribute_filter that prevents access to anything except a few python functions. Is it safe to assume that lua code won't be able to do os.system("rm -rf *") or something like that? From looking at the Lupa doc : Restricting Lua access to Python objects Lupa provides a simple mechanism to control access to Python objects. Each attribute access can be passed through a filter function as follows... It doesn't say anything about preventing or limiting access to facilities provided by Lua itself. If no other modifications are done to

Run Lua script from Python

江枫思渺然 提交于 2019-11-27 15:36:00
问题 Suppose I have a Lua script that contains 2 functions. I would like to call each of these functions with some arguments from a Python script. I have seen tutorials on how to embed Lua code in Python and vice versa using Lunatic Python, however, my Lua functions to be executed in the Python script are not static and subject to change. Hence, I need some way of importing the functions from the .lua file or simply executing the .lua file from the Python script with some arguments and receive a