Software /
code /
prosody
Comparison
plugins/muc/muc.lib.lua @ 11806:6f7d6712e250
MUC: Reject full JID in affiliation queries
XEP-0045 states:
> Affiliations are granted, revoked, and maintained based on the user's
> bare JID, not the nick as with roles.
Therefore inclusion of a full JID in affiliation queries is invalid.
Thanks to Ge0rG and Poezio for discovering this issue.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 17 Sep 2021 16:28:07 +0200 |
parent | 11713:7623767df468 |
child | 11907:0dc2c3530d64 |
comparison
equal
deleted
inserted
replaced
11805:2327e03d1f8d | 11806:6f7d6712e250 |
---|---|
1048 if item.attr.jid then -- Validate provided JID | 1048 if item.attr.jid then -- Validate provided JID |
1049 item.attr.jid = jid_prep(item.attr.jid); | 1049 item.attr.jid = jid_prep(item.attr.jid); |
1050 if not item.attr.jid then | 1050 if not item.attr.jid then |
1051 origin.send(st.error_reply(stanza, "modify", "jid-malformed")); | 1051 origin.send(st.error_reply(stanza, "modify", "jid-malformed")); |
1052 return true; | 1052 return true; |
1053 elseif jid_resource(item.attr.jid) then | |
1054 origin.send(st.error_reply(stanza, "modify", "jid-malformed", "Bare JID expected, got full JID")); | |
1055 return true; | |
1053 end | 1056 end |
1054 end | 1057 end |
1055 if item.attr.nick then -- Validate provided nick | 1058 if item.attr.nick then -- Validate provided nick |
1056 item.attr.nick = resourceprep(item.attr.nick); | 1059 item.attr.nick = resourceprep(item.attr.nick); |
1057 if not item.attr.nick then | 1060 if not item.attr.nick then |