From 67dc0fb56ae204ea57288b56bc85fd28cb2ad1d1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 25 Nov 2016 05:06:13 +0100 Subject: core.stanza_router: Require 'id' attribute on iq stanzas (fixes #785) --- core/stanza_router.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core') diff --git a/core/stanza_router.lua b/core/stanza_router.lua index cf098258..2fb480ee 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -70,6 +70,9 @@ function core_process_stanza(origin, stanza) if not iq_types[st_type] or ((st_type == "set" or st_type == "get") and (#stanza.tags ~= 1)) then origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid IQ type or incorrect number of children")); return; + elseif not stanza.attr.id then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing required 'id' attribute")); + return; end end -- cgit v1.2.3