# HG changeset patch # User Matthew Wild # Date 1638793636 0 # Node ID 9cdbb1b5e6f2c91637e66158de833a23fe2c1a9b # Parent a1fe59c06c48fcfb51b1e61f3e6a8bb8100c53c2 mod_muc_rtbl: Check joining user's host against RTBL diff -r a1fe59c06c48 -r 9cdbb1b5e6f2 mod_muc_rtbl/mod_muc_rtbl.lua --- a/mod_muc_rtbl/mod_muc_rtbl.lua Mon Dec 06 12:26:16 2021 +0000 +++ b/mod_muc_rtbl/mod_muc_rtbl.lua Mon Dec 06 12:27:16 2021 +0000 @@ -100,8 +100,9 @@ return; end - local hash = sha256(jid.bare(event.stanza.attr.from), true); - if banned_hashes[hash] then + local bare_hash = sha256(jid.bare(event.stanza.attr.from), true); + local host_hash = sha256(jid.host(event.stanza.attr.from), true); + if banned_hashes[bare_hash] or banned_hashes[host_hash] then module:log("info", "Blocked user <%s> from room <%s> due to RTBL match", from_bare, event.stanza.attr.to); local error_reply = st.error_reply(event.stanza, "cancel", "forbidden", "You are banned from this service", event.room.jid); event.origin.send(error_reply);