[0.17.76] Admin requirement for certain script actions make no sense
Posted: Tue Nov 12, 2019 3:23 pm
Certain script action like game.kick_player requires the execution context to be a player that is promoted to admin. This makes absolutely no sense as the only way you can execute game.kick_player() is if you have permission to run commands, or if you clicked on a custom script GUI which does it for you.
If you can run commands you can trivially bypass the admin requirement by registering an on_nth_tick event handler and do the kick_player action there as the on_nth_tick event handlers are executed with the server as the context. If you can run commands you can also do things like lock up the server with an infinite loop, delete the world, set yourself to cheat mode, unlock all tech, set spawn to far into biter territory and kill everyone. It's basically unrestricted access to the game, far far more powerful than the things admin promotion let you do.
And if a custom script GUI gives you a button that invokes game.kick_player() isn't it kind of obvious that the intention here is to kick the player? This would be exactly how you'd implement a custom moderator interface that doesn't require admin promotion.
If you can run commands you can trivially bypass the admin requirement by registering an on_nth_tick event handler and do the kick_player action there as the on_nth_tick event handlers are executed with the server as the context. If you can run commands you can also do things like lock up the server with an infinite loop, delete the world, set yourself to cheat mode, unlock all tech, set spawn to far into biter territory and kill everyone. It's basically unrestricted access to the game, far far more powerful than the things admin promotion let you do.
And if a custom script GUI gives you a button that invokes game.kick_player() isn't it kind of obvious that the intention here is to kick the player? This would be exactly how you'd implement a custom moderator interface that doesn't require admin promotion.