Lua 5.3.5 has a use-after-free in lua_upvaluejoin in lapi.c. For example, a crash outcome might be achieved by an attacker who is able to trigger a debug.upvaluejoin call in which the arguments have certain relationships.
https://lists.debian.org/debian-lts-announce/2023/06/msg00031.html
https://github.com/lua/lua/commit/89aee84cbc9224f638f3b7951b306d2ee8ecb71e
https://access.redhat.com/security/cve/cve-2019-6706
http://packetstormsecurity.com/files/151335/Lua-5.3.5-Use-After-Free.html