fix(sandbox): fix potential preload injection issue

This commit is contained in:
Eternity
2026-02-10 17:46:38 +08:00
parent dc2ea5c007
commit 3a09b26b6d

View File

@@ -33,8 +33,6 @@ key = b64decode(key)
os.chdir(running_path) os.chdir(running_path)
# Preload code
{{preload}}
# Apply security if library is available # Apply security if library is available
init_status = lib.init_seccomp({{uid}}, {{gid}}, {{enable_network}}) init_status = lib.init_seccomp({{uid}}, {{gid}}, {{enable_network}})
@@ -42,6 +40,8 @@ if init_status != 0:
raise Exception(f"code executor err - {str(init_status)}") raise Exception(f"code executor err - {str(init_status)}")
del lib del lib
# Preload code
{{preload}}
# Decrypt and execute code # Decrypt and execute code
code = b64decode("{{code}}") code = b64decode("{{code}}")