aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-02 20:12:41 +0200
committerKim Alvefur <zash@zash.se>2020-05-02 20:12:41 +0200
commitdc8d810f34ba55ec51a238a84c04673efb7fc7a3 (patch)
tree0568e2f530cd1a64c9434d077c4059b05b1c294e /plugins/muc
parent75a3d7758bda32792bb3abe412b12f8c85bf757f (diff)
downloadprosody-dc8d810f34ba55ec51a238a84c04673efb7fc7a3.tar.gz
prosody-dc8d810f34ba55ec51a238a84c04673efb7fc7a3.zip
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.
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/register.lib.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/muc/register.lib.lua b/plugins/muc/register.lib.lua
index f0a15dd4..d917b396 100644
--- a/plugins/muc/register.lib.lua
+++ b/plugins/muc/register.lib.lua
@@ -152,7 +152,7 @@ local function handle_register_iq(room, origin, stanza)
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;