aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-08-29 23:26:19 +0200
committerKim Alvefur <zash@zash.se>2021-08-29 23:26:19 +0200
commitd915f98800f1740242a56b0c29b129a686fe1c9d (patch)
tree8750b06162997804d57d87624d8927db5b93e5e9 /plugins
parent4ddf47aaf0ec7783cb69475000c8f09dd651d678 (diff)
downloadprosody-d915f98800f1740242a56b0c29b129a686fe1c9d.tar.gz
prosody-d915f98800f1740242a56b0c29b129a686fe1c9d.zip
mod_external_services: Validate required attributes on credentials requests
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_external_services.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_external_services.lua b/plugins/mod_external_services.lua
index 1a6c80bd..6fafdb1f 100644
--- a/plugins/mod_external_services.lua
+++ b/plugins/mod_external_services.lua
@@ -175,7 +175,7 @@ local function handle_credentials(event)
local action = stanza.tags[1];
if origin.type ~= "c2s" then
- origin.send(st.error_reply(stanza, "auth", "forbidden"));
+ origin.send(st.error_reply(stanza, "auth", "forbidden", "The 'port' and 'type' attributes are required."));
return true;
end
@@ -188,6 +188,11 @@ local function handle_credentials(event)
local requested_credentials = {};
for service in action:childtags("service") do
+ if not service.attr.type or not service.attr.host then
+ origin.send(st.error_reply(stanza, "modify", "bad-request"));
+ return true;
+ end
+
table.insert(requested_credentials, {
type = service.attr.type;
host = service.attr.host;