Skip to content

Commit

Permalink
Validate event timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 17, 2021
1 parent e33008a commit 8fd4c1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions synapse/events/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def validate_new(self, event: EventBase, config: HomeServerConfig):
# checked, since we trust the portions of the event we created.
validate_canonicaljson(event.content)

if not 0 < event.origin_server_ts < 2 ** 53:
raise SynapseError(400, "Event timestamp is out of range")

if event.type == EventTypes.Aliases:
if "aliases" in event.content:
for alias in event.content["aliases"]:
Expand Down

0 comments on commit 8fd4c1d

Please sign in to comment.