Blacklist shell syscalls in Lua for now (security)
parent
11a2adbea6
commit
72b4ecdc36
|
@ -26,10 +26,10 @@ export function buildLuaEnv(system: System<any>, scriptEnv: ScriptEnvironment) {
|
|||
function exposeSyscalls(env: LuaEnv, system: System<any>) {
|
||||
// Expose all syscalls to Lua
|
||||
// Except...
|
||||
const exclude = ["template"];
|
||||
const blacklist = ["template", "shell"];
|
||||
const nativeFs = new LuaStackFrame(env, null);
|
||||
for (const syscallName of system.registeredSyscalls.keys()) {
|
||||
if (exclude.includes(syscallName)) {
|
||||
if (blacklist.includes(syscallName)) {
|
||||
continue;
|
||||
}
|
||||
const [ns, fn] = syscallName.split(".");
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
The Shell API provides functions for running shell commands.
|
||||
|
||||
### shell.run(cmd, args)
|
||||
Runs a shell command with the specified arguments.
|
||||
|
||||
Example:
|
||||
```lua
|
||||
local result = shell.run("ls", {"-la"})
|
||||
print("Output: " .. result.stdout)
|
||||
print("Errors: " .. result.stderr)
|
||||
print("Exit code: " .. result.code)
|
||||
```
|
Loading…
Reference in New Issue