globals.load(new PackageLib()) is necessary? #118
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using the lua script in java code, and to reduce the risk, I want to just use the base module,(not all of JsePlatform.standardGlobals()),
it's the config code:
`public class LuaConfig {
private final Globals globals;
}`
and throw expection Caused by: org.luaj.vm2.LuaError: attempt to index ? (a nil value) ,
after deubg I found only the JseBaseLib moudle can be loaded without PackageLib;
If load PackageLib , how could I only use the base function and avoid the risk of PackageLib moudule (avoid the Injection Attacks )?
could it be safety completed by next code ?
`
// load other ...
globals.load(new PackageLib());
// don't use require
globals.set("require", LuaValue.NIL);
// load other ...
`
the risk scene could be looked at : script as param in http request