Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Limit the size of the aggregation_key #12101

Merged
merged 4 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12101.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Limit the size of `aggregation_key` on annotations.
3 changes: 3 additions & 0 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,9 @@ async def _validate_event_relation(self, event: EventBase) -> None:
if already_exists:
raise SynapseError(400, "Can't send same reaction twice")

if len(aggregation_key) > 500:
raise SynapseError(400, "Aggregation key is too long")
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved

# Don't attempt to start a thread if the parent event is a relation.
elif relation_type == RelationTypes.THREAD:
if await self.store.event_includes_relation(relates_to):
Expand Down