Validate event timstamps

This commit is contained in:
Tulir Asokan 2021-07-20 16:33:09 +03:00
parent 9754df5623
commit 97132bcf7d

View File

@ -64,6 +64,8 @@ class EventValidator:
# Note that only the client controlled portion of the event is # Note that only the client controlled portion of the event is
# checked, since we trust the portions of the event we created. # checked, since we trust the portions of the event we created.
validate_canonicaljson(event.content) validate_canonicaljson(event.content)
if not 0 < event.origin_server_ts < 2 ** 53:
raise SynapseError(400, "Event timestamp is out of range")
# meow: allow specific users to send potentially dangerous events. # meow: allow specific users to send potentially dangerous events.
if event.sender in config.meow.validation_override: if event.sender in config.meow.validation_override: