Right now hlua checks type safety by writing the TypeId of the userdata in the index __typeid of its metatable.
However this could be easily modified by the library user or even maybe by a Lua script.
Of course it would be very stupid for a user to modify the value in __typeid. If all actors cooperate, then there's no unsafety. But safety is all or nothing. If for example you write a Lua REPL with hlua and take user input, then there is a security leak here.
Right now hlua checks type safety by writing the TypeId of the userdata in the index
__typeidof its metatable.However this could be easily modified by the library user or even maybe by a Lua script.
Of course it would be very stupid for a user to modify the value in
__typeid. If all actors cooperate, then there's no unsafety. But safety is all or nothing. If for example you write a Lua REPL with hlua and take user input, then there is a security leak here.