MUC: Enforce strict resourceprep when registering room nicknames
If nickname enforcement is enabled this would otherwise let you bypass
the join check in muc.lib by registering an invalid nickname and then
joining with any nickname, letting register.lib change it to the invalid
registered nick.
--- a/plugins/muc/register.lib.lua Sat May 02 14:13:02 2020 +0200
+++ b/plugins/muc/register.lib.lua Sat May 02 20:12:41 2020 +0200
@@ -152,7 +152,7 @@
return true;
end
-- Is the nickname valid?
- local desired_nick = resourceprep(reg_data["muc#register_roomnick"]);
+ local desired_nick = resourceprep(reg_data["muc#register_roomnick"], true);
if not desired_nick then
origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid Nickname"));
return true;