Skip to content
Snippets Groups Projects
Unverified Commit 61fd2a8f authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Limit the size of the aggregation_key (#12101)

There's no reason to let people use long keys.
parent 31b125cc
No related branches found
No related tags found
No related merge requests found
Limit the size of `aggregation_key` on annotations.
......@@ -1069,6 +1069,9 @@ class EventCreationHandler:
if relation_type == RelationTypes.ANNOTATION:
aggregation_key = relation["key"]
if len(aggregation_key) > 500:
raise SynapseError(400, "Aggregation key is too long")
already_exists = await self.store.has_user_annotated_event(
relates_to, event.type, aggregation_key, event.sender
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment