(no title)
girvel | 1 year ago
Overall, it would be nice to make it safer. I don't think switching to non-Lua format would make it safer, because it is intended to serialize functions too, which can have arbitrary code even if everything else would be stored as data. Maybe it is possible to make a function like `ldump.safe_load` restricting `load`'s environment, so it wouldn't have access to debug/os/io modules.
gvx|1 year ago
Running arbitrary code was such a problem that I just completely ruled it out for bitser. Instead of serializing functions, you can register safe functions as resources. This doesn't solve the upvalue problem, though.
girvel|1 year ago
myrmidon|1 year ago
But this is probably a non-issue for a lot of usecases.
See e.g.
https://gist.github.com/corsix/6575486
https://www.corsix.org/content/malicious-luajit-bytecode
lifthrasiir|1 year ago