Skip to content

Commit 8fd4c1d

Browse files
committed
Validate event timestamps
1 parent e33008a commit 8fd4c1d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

synapse/events/validator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def validate_new(self, event: EventBase, config: HomeServerConfig):
6565
# checked, since we trust the portions of the event we created.
6666
validate_canonicaljson(event.content)
6767

68+
if not 0 < event.origin_server_ts < 2 ** 53:
69+
raise SynapseError(400, "Event timestamp is out of range")
70+
6871
if event.type == EventTypes.Aliases:
6972
if "aliases" in event.content:
7073
for alias in event.content["aliases"]:

0 commit comments

Comments
 (0)