4 ms·
> I wonder if they'd take patches to stop the interpreter trusting the input The stance of the Lua developers AIUI is that processes that execute arbitrary Lua
by haberman 2y ago
> I wonder if they'd take patches to stop the interpreter trusting the input
The stance of the Lua developers AIUI is that processes that execute arbitrary Lua code should only accept source, and disable direct loading of byte code.
This seems reasonable to me, as it preserves the option of directly loading trusted byte code, while avoiding putting dynamic checks into the interpreter that would affect all users.
- pansa2 2y agoCorrect. From the Lua 5.2 manual [0]: "all functions that load code are potentially insecure when loading untrusted binary data. [...] When in doubt, use the mode argument of those functions to restrict them to loading textual chunks." I thought this was widely known within the Lua community - I'm amazed that Factorio would support loading untrusted bytecode. Was that a decision the game's developers actively made (for what reasons?) or were they simply unaware of the risks? [0] https://www.lua.org/manual/5.2/manual.html#8.2 https://www.lua.org/manual/5.2/manual.html#8.2