diff --git a/README.md b/README.md index d1bdb1c..ef23c9b 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,8 @@ if it determines they are necessary for your server: - Blocking newlines in chat messages (MT < 5.0.1). - Prevent saying `%2` in chat from crashing the server (MT == 5.1.0). + - Prevent hacked clients from being able to access the inventories of other + players (MT < 5.4.0). If you do not want this for whatever reason (although I do not recommend it), you can disable these backports by adding `cloaking.backport_bugfixes = false` diff --git a/init.lua b/init.lua index 0050e32..502b59f 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,7 @@ -- -- Minetest player cloaking mod -- --- © 2019 by luk3yx +-- © 2020 by luk3yx -- local path = minetest.get_modpath('cloaking') dofile(path .. '/core.lua') @@ -71,3 +71,13 @@ if minetest.format_chat_message then end end end + +-- Backport https://github.com/minetest/minetest/pull/10341 +-- TODO: Only apply this workaround on vulnerable MT versions. +minetest.register_allow_player_inventory_action(function(player, action, inv) + local inv_location = inv:get_location() + if inv_location.type == 'player' and + inv_location.name ~= player:get_player_name() then + return 0 + end +end)