Skip to content

Userdata is unsafe #115

Closed
Closed
@tomaka

Description

@tomaka

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions