component file sharing: forbid jingle upload by entities which are not in allowed hosts

This commit is contained in:
Goffi 2021-05-05 15:41:19 +02:00
commit 76392e9377

View file

@ -508,6 +508,9 @@ class FileSharing:
"""This trigger accept file sending request, and store file locally"""
if not client.is_component:
return True, None
# client._file_sharing_allowed_hosts is set in plugin XEP-0329
if peer_jid.host not in client._file_sharing_allowed_hosts:
raise error.StanzaError("forbidden")
assert stream_object
assert "stream_object" not in transfer_data
assert C.KEY_PROGRESS_ID in file_data